Martinez, featuring in the starting line-up for the first time in the competition, found the net in the 47th and 86th minutes, scoring for a third straight match.
The Inter Milan striker finished off a flowing move in the 47th minute, coolly chipping the ball over Peru keeper Pedro Gallese, and repeated the trick in the 86th minute, chipping Gallese again for his second goal after some sloppy defending by Peru.
"I'm happy, because I was able to score in the three group-stage games and because I was able to help the team, which is what counts," Martinez, who was criticised for his performances in Argentina's World Cup-winning campaign in 2022, told TyC Sports.
"I'm fine, as I said when the match with Chile ended, I had a great season at my club and I felt good.
"I felt ready to get rid of the thorn from the World Cup, that was important for me, to prepare well for the Copa America, which I did and I'm showing it. Let's keep working."
Argentina had already qualified for the quarter-finals before the match in Miami with wins over Canada and Chile, the other teams in the group.
That security allowed the defending champions to rest key players, including captain Lionel Messi.
Messi, who celebrated his 37th birthday on Monday, is recovering from a thigh injury he picked up during their win over Chile on Tuesday. He is expected to return for their quarter-final match on Thursday in Houston against the Group B runner-up.
Despite the absence of their coach Lionel Scaloni, suspended and fined for late second-half starts in two previous matches, and a much-changed starting line-up, Argentina were largely untroubled by their opponents.
They dominated possession in the first half and had three attempts on target, but Peru's goalkeeper Gallese kept the scoreline respectable with a string of saves, the most notable of which came from a well-struck free kick by Leandro Paredes in the 26th minute.
The defending champions had a gilt-edged chance to extend their lead when they were awarded a penalty for handball in the 72nd minute, but Paredes smashed his spot-kick off the post.
They will be joined in the knockout rounds by group runners-up Canada, who qualified for the last eight after holding Chile to a 0-0 draw in the other Group A match.