The tack-on run proved to be the difference as Stanton led off the eighth with a homer off Carlos Torres. It was the slugger's third homer in as many games, and he moved into a tie with Baltimore's Nelson Cruz for the MLB lead with 36 blasts.
Stanton now has 153 career homers, one shy of Dan Uggla's franchise record.
Still, New York claimed two of three at Marlins Park, and have won seven of its last eight from Miami. The Marlins are 67-71, while the Mets improved to 66-74, two games back in the division standings. Miami is 6-10 overall against New York this season.
"Any time we lose this time of year, we all know where we're at," Miami manager Mike Redmond said. "You've got to win ballgames. We all know that. You don't have to remind guys, and guys are battling. This is a new spot for us, playing games with a little bit of pressure. Unfortunately, we didn't play well enough to win."
The Marlins have dropped four straight series after splitting a two-game set with the last-place Rangers.
"It's tough," Miami starter Tom Koehler said. "Obviously, we know what we have in front of us. We know what needs to be done. I don't want to say guys are pressing. We're not doing that. That big pitch, that big play, that big hit, we're missing. Unfortunately, it's the little things inside the game that are coming back to hurt us right now."
The lack of shutdown innings also is biting Miami. Twice on Wednesday, the Mets responded with runs immediately after the Marlins scored.
After Christian Yelich hit a game-tying RBI single in the seventh inning, New York responded with two runs charged to Mike Dunn in the eighth. Matt den Dekker's bunt single got the inning going. With one out, Lucas Duda singled. Bryan Morris relieved Dunn and allowed the tie-breaking double to d'Arnaud. With one out, Herrera drove in the second run of the inning on his fielder's choice, beating out a double-play grounder.
"The first guy laid down the perfect bunt, and I hung a slider to Duda," Dunn said. "You can't do that in the eighth."
The Marlins ended up letting a game slip away on a night Koehler struck out a career-high 10 over seven innings. The right-hander was hurt by a two-run homer to Kirk Nieuwenhuis in the fourth inning. Other than that, he was impressive. Previously, he had fanned as many as eight.
"Sometimes you've got to go out there and win a ballgame, 1-0," Koehler said. "That's what you see the really solid starters do. They go out there when the team gives them a lead, and they shut them down."
Jacob deGrom logged 114 pitches over six innings, but he gave up just one run in a no-decision for New York.
"Jake really struggled with his command," Mets manager Terry Collins said. "But as he's done all year long, he keeps us in the game because he's got good enough stuff."
With deGrom out after six, the Marlins responded in the seventh to pull even at 2. Adeiny Hechavarria doubled with one out off Buddy Carlyle. With two outs and a runner on third, lefty Dario Alvarez made his MLB debut against Yelich, who delivered the game-tying single to right.
The Marlins, who were in a stretch of scoring one run in 16 innings against deGrom, were able to get on the board in the third inning. Miami pushed across the run on Casey McGehee's infield single that deflected off deGrom's glove.
Each team had chances in the first inning. New York opened the game by putting runners on second and third with no outs. But Koehler struck out David Wright, Duda and d'Arnaud in succession.
"The Mets have played us tough, and they've hit our pitchers," Redmond said. "That's just it. They've found a way to get a bunch of hits and score runs against our guys."