The Central Americans, who will participate in this month’s Gold Cup tournament while Argentina battle it out in Brazil, frustrated the home side initially.
But it was left to captain Messi to spark his side into action in their only warm-up match ahead of the tournament, expertly opening the scoring on 37 minutes before grabbing another just 96 seconds later.
Lautaro Martinez, the Inter Milan forward, also scored twice, coming off the substitutes bench at half-time to give coach Lionel Scaloni food for thought ahead of the opening match with Colombia on June 15.
Scaloni, brought in after Jorge Sampaoli was sacked following a disastrous showing at the World Cup last summer, is aiming to build a younger team and end Argentina’s 26-year wait for a trophy.
Indeed, in Scaloni’s Copa America squad only Messi, Sergio Aguero and Angel Di Maria remain from the one that was beaten by Germany in the World Cup final in Rio five years ago.
An on-song Messi, however, is needed for the South Americans to prosper over the next few weeks.
Messi has lost three Copa finals —- 2007, 2015 and 2016 -- and the last time Argentina won an international title was in the same competition back in 1993, when the diminutive forward was just six years old. They have reached four of the last five finals.
With Brazil missing the injured Neymar for the showpiece event, which starts on June 14, Argentina are one of the favourites.
Early on in Friday's first meeting between Argentina and Nicaragua, Scaloni’s team failed to inspire in front of a sell-out crowd of 25,000 at San Juan del Bicentenario stadium in San Juan, Argentina.
Aguero looked dangerous in the opening stages and Messi really should have done better on 12 minutes when he uncharacteristically shot wide from close range.
Nicaragua, however, were defending well while regularly asserting their physicality -- Messi was twice hauled down in the opening half hour -- to frustrate Argentina and their supporters.
River Plate's Matias Suarez had a shot pushed onto the post by visiting keeper Justo Lorente on 26 minutes but the two time World Champions were being made to work hard for openings.
Nicaragua, ranked 129th in the world and competing in their second successive Gold Cup, will prove a stern test for Costa Rica, Haiti and Bermuda despite this thrashing. They have yet to win a game in two appearances at the tournament -- lost six with just one goal scored -- but won't go down without a fight.
Messi, however, is a danger for any team and his brilliant run and finish saw the Barcelona star beat three defenders before clinically finishing past Lorente. He grabbed his second soon after when Aguero's shot was parried.
Scaloni withdrew key men Messi and Aguero at half-time, which allowed Martinez, 21, to impress with a well taken efforts on 63 and 72 minutes. Watford's Roberto Pereyra made it five with nine minutes remaining while Nicaragua's deserved consolation came through Juan Barrera's late penalty.
Argentina play Colombia in Salvador before taking on Paraguay and Asian champions Qatar in Group B.