Messi's typically crafty effort after scurrying through three defenders in the 83rd minute was enough to secure three points, with an own goal by his teammate Ian Fray four minutes later ruled out for a marginal offside.
The 39-year-old Argentine superstar also provided an improvised assist off the back of his head for German Berterame, after Daniel Gazdag had put New England in front early in the second half.
Victory sent Miami a point clear of the New England Revolution with one game left, meaning a win against Charlotte on Saturday will guarantee home advantage until the Conference Finals.
It also secured Miami's spot in next year's CONCACAF Champions Cup.
"It was such an important occasion...they're a very tough team - really difficult - so I think it was a tremendous effort," said Berterame.
After a goalless first half, New England's Peyton Miller slipped down the right flank to the byline in the 53rd minute. His cut-back pass was backheeled by Ilay Feingold to Gazdag, who smashed the ball home.
Miami came close to equalizing soon after the hour, as Berterame followed up on a Messi effort saved by Matt Turner, only to have his shot cleared off the line by Brooklyn Raines.
In the 69th minute, Telasco Segovia flicked a ball high into the box toward Messi, who was racing forward between two defenders but somehow headed it blindly off the back of his head to Berterame, who scored.
Messi got on the scoresheet himself in the 83rd minute, collecting the ball just outside the D, spinning and skipping past three tackles before wrapping his left foot around the ball and sending it low into the far corner past US national team goalkeeper Turner.
New England thought they had been gifted an equalizer with three minutes remaining.
Fray inexplicably headed a hopeful Luca Langoni cross into his own net despite no pressure, but the New England substitute was ruled offside on video review.
The Eastern Conference's final playoff berths were also determined Sunday.
Columbus Crew and Orlando City both qualified after 10th-placed New York Red Bulls lost 3-2 to runaway leaders Nashville.
Sam Sturridge's stoppage-time strike sealed a comeback victory from 2-0 down for Nashville, who have tied the record for the most points in MLS history, on 74, with a game still to play.
Nashville lifted the Supporters' Shield trophy on Sunday at their Geodis Park stadium, where they have not lost all year, becoming the first team in MLS history with 15 home wins.
Higher seeds retain home advantage through the postseason until the MLS Cup, which will take place on December 18th.
