The Argentina international kept the Nerazzurri on course for a potential domestic double, after a goalless first leg last month set up a winner-takes-all clash this week.
With the Supercoppa Italia already secured against Juventus and Milan merely two points ahead with a game out of hand, Inter could yet complete a clean sweep of domestic honours.
Simone Inzaghi claimed a maiden Derby della Madonnina win with the result, and his side will now wait to discover if they face holders Juventus or Fiorentina.
With defeat leaving Stefano Pioli and his side with just the Scudetto left to fight for, though, the stage is now set for a thrilling conclusion to the Serie A season too.
The whistle for kick-off had barely sounded before Inter struck, Martinez volleying Matteo Darmian's neat cross home near the penalty spot.
Such an early goal forced Milan onto the offensive, with Rafael Leao and Alexis Saelemaekers going closest in response.
Frenetic closing exchanges to the first half saw Ivan Perisic make a goal-saving clearance on the line, before the Nerazzurri scored effectively in the next passage.
Following Marcelo Brozovic's release in transition, Martinez dinked Joaquin Correa's throughball over Mike Maignan for a second to double the lead just before half-time, and it became a mountain for Milan to climb.
The Rossoneri continued to rally after the interval and critically had Ismael Bennacer's goal disallowed, with Pierre Kalulu ruled offside. From there the air went out of the game and when Martinez bowed out with 20 minutes to go, it felt like the game was already over, even before Robin Gosens slid home a third to seal the deal.