The Colombia striker's 57th minute strike was the difference between the two teams, setting up an intriguing second leg in Italy next week
Porto dominated for large periods of Thursday's game, but a combination of an incorrect offside decision that ruled out Eduardo's effort and the outstanding Pepe Reina frustrated them.
There was nothing Reina could do, though, to stop Martinez netting the only goal after he reacted quickest to sweep home from 12 yards.
Martinez's 23rd goal of the season in all competitions means Porto travel to Italy for the second leg next week with high hopes of reaching the quarter-finals.
The Portistas ended a four-game winless run in all competitions at the weekend with a confidence-boosting 4-1 victory over Arouca and bossed the first half against Napoli with ease.
In what was the first European game in charge for interim coach Luis Castro, Porto could have been ahead early on but for a remarkable save from Reina.
Carlos Eduardo chipped a delightful ball to Martinez and he met it sweetly on the half-volley, but Reina showed great reflexes to tip away the shot.
The 2010-11 Europa League winners continued to have the better of proceedings, with Steven Defour next to sting the palms of Reina.
Castro's men should have been in front after 19 minutes when Martinez's inviting cross was nodded in by Eduardo, only for it to be incorrectly ruled offside.
The pattern of dominance continued in the early exchanges of the second half when Reina produced another superb stop to acrobatically claw away Fernando's rasping 30-yard drive.
Ricardo Quaresma scored two goals at the weekend and impressed again but his 50th minute strike drifted wide.
Rafael Benitez is aiming to become the first manager to win the competition with three different clubs and his side finally showed some attacking intent after 52 minutes.
Napoli broke the offside trap and Jose Callejon set up Gonzalo Higuain. His shot was low and powerful but it went through Helton's legs and squirmed wide.
The Porto goalkeeper was in action yet again when Raul Albiol was left unmarked from a corner, but his low header was kept out by the feet of the Brazilian.
Helton brilliantly denied Higuain and the ball fell to Callejon six yards out, but he could not sort his feet out.
But the game swung the way of the home side after 57 minutes when a corner was only half cleared and Martinez showed great technique 12 yards out to lash home via a deflection.
It somehow stayed as 1-0 to the hosts with nine minutes remaining when Miguel Britos made a last-ditch tackle and his clearance from the floor went cannoned straight at Juan Quintero and onto the post.