Messi missed Argentina's previous four matches due to a suspension for accusing CONMEBOL of favouring hosts Brazil – who won their semi-final meeting – at the Copa America and he made a decisive impact in the friendly, billed as the Superclasico de las Americas, as the Selecao's winless streak reached five games.
The five-time Ballon d'Or winner earned Argentina an early penalty and netted at the second time of asking after Gabriel Jesus had also spurned an opportunity from 12 yards.
Another couple of chances were crafted for Messi, but he failed to add to his tally and the match became extremely scrappy and disjointed after the break, with clear-cut chances at a premium.
A ferocious start saw both sides awarded a penalty inside the first 12 minutes and remarkably neither of them were scored, with Jesus missing the target after being tripped by Leandro Paredes, before Messi had his saved by Alisson.
But luckily for Argentina and the returning Messi, Alisson put the ball right back into the danger zone and the Barcelona star buried the rebound.
Messi went close to a second in rather more characteristic fashion, as he dribbled from inside his own half and got a shot away from the edge of the box, but his effort was a little tame and Alisson stopped it easily.
The second half was significantly untidier, though Argentina still looked more threatening, with Messi's long-range free-kick forcing Alisson to tip it over.
Lautaro Martinez should have wrapped things up 10 minutes from time when he blazed over inside the area, though Brazil – who handed Rodrygo Goes and Wesley debuts from the bench – were unable to punish the let-off and Argentina claimed victory.