Veteran Haiti international Fafa Picault headed in the winning goal in the 89th minute to give Miami a precious victory that extended their unbeaten start to the season.
Messi provided the assists for both Miami's goals including the leveler which came in the 10th minute of stoppage time.
"Messi has been the type of boost that MLS has needed. The issue for MLS has been attracting stars at the end of their career," said Andrew Zimbalist, a professor at Smith College and co-author of National Pastime: How Americans Play Baseball and the Rest of the World Plays Football.
More than 11 million fans have flocked to Major League Soccer games this season, the league said Monday, breaking the previous record of 10.9 millions fans who attended games in 2024.
Miami started with all their big-name stars, including Lionel Messi, on the bench but the Argentine was introduced in the 61st minute to the delight of many in the Toronto crowd.
Expecting massive fan interest, MLS announced Thursday that the opener will be livestreamed for free on Apple TV and aired as it happens on the gargantuan 25,000-square-foot video screen at Times Square in New York.
Inter Miami's charge towards Major League Soccer's single-season points record suffered a setback on Saturday after a last-gasp injury-time equalizer from James Sands snatched a 1-1 draw for New York City FC against the Eastern Conference leaders.
Lionel Messi is set to return to action with his club Inter Miami on Saturday after spending over two months out with an ankle injury, Miami coach Gerardo Martino said on Friday.
Luis Suarez struck twice as ten-man Inter Miami became the first team to book their place in this season's Major League Soccer playoffs after beating Cincinnati 2-0 at Chase Stadium on Saturday.
The league's top talents will face the Mexican League All-Stars on July 24 at Columbus, Ohio.
Inter Miami rested Lionel Messi and Luis Suarez but still managed to extend their unbeaten run in Major League Soccer to 10 games with a hard fought 2-1 win at the Vancouver Whitecaps on Saturday.
Messi, 36, has become the face of MLS since joining Miami last July, but he has yet to make an appearance in Vancouver.
Lionel Messi's record $20.45 million annual salary from Inter Miami makes him by far the best paid player in Major League Soccer but also puts him ahead of the entire squads of 25 of the league's clubs, according to data released by the MLS Players Association on Thursday.
Inter Miami's five-match winning run came to an end on Wednesday as, without the injured Lionel Messi, they were held to a 0-0 draw at Orlando City.
Olivier Giroud confirmed on Monday that he will leave AC Milan at the end of the season to end his long career in Major League Soccer.
Messi's five assists, which all came in the second half, are a new record for an MLS game and he now has 10 goals and 12 assists in eight league appearances so far this season.
A crowd over 65,612 turned up at Gillette Stadium in Foxborough, Massachusetts, the stadium the Revolution share with the NFL's New England Patriots, to see the Argentine World Cup winner.
France's record goal scorer Olivier Giroud has reached agreement with Los Angeles FC to join the Major League Soccer club this summer, sources close to the player confirmed on Tuesday.
Everything Miami was creating was coming through Messi, who flashed a snapshot wide before moments later whipping in a cross for a Gomez header which was saved by Panicco's feet.