Argentina striker Martinez lashed home his fourth goal of the season in all competitions on the hour mark after a poor clearance from Zeki Celik to give Inter a hard-fought win at the Stadio Olimpico in Rome.
Lautaro confirming his intention to stay at Inter is a huge boost for a club which headed into the close season in uncertain mood after a sudden change in ownership.
It’s a huge relief for the Inter Milan marksman, who had experienced a miserable 18 months.
With Messi sidelined after complaining of a sore right hamstring, and coach Lionel Scaloni serving a one-game suspension, Argentina made nine changes to their starting XI at the Hard Rock Stadium.
Just as it looked like Argentina would be made to rue their missed chances substitute Martinez pounced on a rebound from a corner and lashed home a right-footed shot in the 88th minute to ensure victory and a top-two spot in the group for the defending champions.
Lautaro Martinez, this season's Serie A top scorer, put Argentina ahead with a penalty kick in the 39th minute before netting his second from a Messi pass after the break.
"Now, I feel like crying because we worked so hard, suffered so much, we deserved this joy," the 26-year-old told DAZN.
Angel Di Maria, Alexis Mac Allister and Lautaro Martinez rescued Argentina on Tuesday as the world champions came from behind to beat Costa Rica 3-1 in an international friendly in Los Angeles.
Martinez has gone 16 consecutive games without scoring a goal, spanning a total of 772 minutes.
Argentina are looking to put their shock 2-1 opening defeat by Saudi Arabia behind them as they prepare for their World Cup Group C match against Mexico on Saturday, a game they now feel they absolutely must win.
Inter Milan made it two from two in Serie A with Saturday's comfortable 3-0 win over Spezia on Romelu Lukaku's return to the San Siro.