Bayern stormed out of the blocks in the first leg of their Champions League quarter-final, with Michael Olise and Harry Kane both going close for the hosts at Allianz Arena on Tuesday night.
The ex-Crystal Palace man stung the hands of Inter goalkeeper Yann Sommer, and Raphael Guerreiro brought a good reaction save out of the Swiss as Vincent Kompany's men pinned the visitors back.
The best chance of the game then fell to Kane after Olise danced past a number of defenders but the England captain could only fire against the outside of the post.
And they were made to pay for their profligacy as Martinez nonchalantly fired into the top corner with the outside of his right foot following a delightful Marcus Thuram flick in the 38th minute.
Bayern struggled to recapture the verve they showed early on, as Martinez brought a smart stop out of Jonas Urbig.
The Bundesliga leaders needed a bit of brilliance and nearly got it through Guerrero when his 20-yard volley whistled just inches over the bar.
It looked like the German giants had secured a hard-fought draw when substitute Thomas Muller stabbed home from three yards five minutes from time.
But fellow substitute Frattesi broke the home team's hearts when he turned in Carlos Augusto's cross just three minutes later. Bayern pushed for an equaliser but to no avail as Inter secured a slight advantage heading into the second leg of the Champions League quarter-finals.