The Inter Miami forward had failed to find the mark in La Albiceleste's opening four games of the tournament, although he was benched for the final group fixture versus Peru amid concerns over his fitness.
Messi subsequently played the full 90 against Ecuador in the last 16, as Argentina progressed in spite of the eight-time Ballon d'Or winner missing his penalty in the shootout, and he unsurprisingly kept his place in the first XI for the semi-final showdown with Canada.
Lionel Scaloni's men needed just 22 minutes to get off the mark at the MetLife Stadium, as Julian Alvarez latched onto Rodrigo de Paul's eye-of-the-needle pass and slotted home past Maxime Crepeau.
With six minutes played in the second period, the holders doubled their lead through captain Messi, although the 37-year-old's goal was not one of the most conventional he has scored in his career.
Messi becomes second-highest male international scorer of all time
Chelsea midfielder Enzo Fernandez let fly from the edge of the area, and his strike was helped on its way into the back of the net via the studs of an onside Messi, who was credited with the goal.
In doing so, the ex-Paris Saint-Germain and Barcelona attacker scored for the 109th time for Argentina, seeing him overtake Iran's Ali Daei as the second-highest male goalscorer in international football history.
Messi has surpassed Daei just a month on from matching his record of 108 in June's friendly win over Guatemala, although he is still some way off matching or breaking the all-time record set by Cristiano Ronaldo.
Messi's long-time on-field rival has struck 130 times for Portugal, meaning that the Argentine needs another 21 goals for his nation to equal Ronaldo, who failed to find the back of the net once at Euro 2024 excluding penalty shootouts.
However, both men are dwarfed by the feats of Canada's Christine Sinclair, who is the highest international scorer in men's or women's football with an astounding 190 goals in 328 matches.
Will Messi break Ronaldo's all-time men's record?
Many have expected Ronaldo to call time on his international career in the wake of a failed Euro 2024 campaign, but the 39-year-old has hinted that he wants to continue in the Portugal setup for a little while longer.
Whether that will extend to an appearance at the 2026 World Cup remains to be seen, but Messi is expected to still be kicking by the time that tournament rolls around in what may be his international swansong.
The 37-year-old therefore still has ample time to draw closer to Ronaldo's 130 - unless the Al-Nassr forward postpones his international retirement and extends his record - but Messi admitted after the beating of Canada that his time is nearing an end too.
"I am aware that these are the last few battles, that is why I am enjoying it very much. Let's enjoy everything that we are living and enjoying as a national team. It is not easy to get to another final," Messi told the press after the game. "We have to take advantage because it's not something easy These are some of my last battles and I have to enjoy."
Argentina will face either Uruguay or Colombia in the 2024 Copa America final, which takes place on Saturday at the Hard Rock Stadium in Florida.