MIAMI -- Billy Wagner stood at his locker, spitting tobacco into a water bottle and savoring the taste of victory.
Wagner needed 22 pitches in the ninth inning for his 23rd save in 28 chances.
"It would be better if I could just throw nine pitches and get three guys out every time, but it doesn't seem to work like that," he said. "I don't know why."
The Marlins committed four errors, which matched their season high, leading to two unearned runs and a 6-0 deficit by the third inning.
Miguel Cabrera hit a homer and drove in four runs, and Hanley Ramirez also homered to help Florida close the margin to one run. That set the stage for Wagner, who blew a save Tuesday by giving up pinch-hitter Josh Willingham's game-ending two-run homer.
"To go back out there and try to get it done, that's the name of the game," Wagner said.
He quickly found himself in a jam, giving up a single to Wes Helms and hitting pinch-hitter Brian Moehler, a pitcher, trying to bunt.
Ramirez also attempted to sacrifice and fouled off strike three.
"I'm glad he was bunting," the hard-throwing Wagner said. "It's not easy to bunt off me."
Reaching 97 mph on the scoreboard radar gun, the left-hander then struck out Dan Uggla and Cabrera.
"Billy came in and redeemed himself," Mets manager Willie Randolph said. "A closer's life is difficult at times, and he understands that. To get him back out there tonight and have him bounce back after a first-and-second situation is huge for him."
The Mets, who have the NL's best record at 64-42, won for the fifth time in six games. They blew a 4-1 advantage Tuesday but this time protected their lead -- barely.
Roberto Hernandez, making his first appearance since being reacquired by the Mets, gave up two runs in one inning of relief. Chad Bradford retired one batter, and Aaron Heilman pitched a perfect eighth for the second successive night.
The Mets improved to 23-11 in one-run games. Florida fell to 13-21.
"We made them work for it," Marlins manager Joe Girardi said. "The first three innings weren't as good as the last six. We gave them too many runs early."
Steve Trachsel (10-5) gave up two homers and three runs in 5 2/3 innings but won for the eighth time in his past nine decisions. He reached 10 victories for the fifth time in six years.
The Marlins' Ricky Nolasco (9-7), who had won his previous three starts, gave up five runs -- four earned -- and departed for a pinch hitter after only two innings. He fell to 0-3 in three starts against New York this year with an ERA of 21.13.
"If you don't make good pitches against the Mets, you can expect that to happen," said Nolasco, whose ERA against all other teams is 2.76.
Two errors helped the Mets score four runs in the first. Jose Reyes led off with a single, advanced with his 44th stolen base and came home on Paul Lo Duca's single. Carlos Beltran walked, and Carlos Delgado singled to load the bases.
Cliff Floyd lined a one-out RBI single, and when right fielder Jeremy Hermida bobbled the ball, Beltran scored. Endy Chavez reached on a two-out infield hit, and when Nolasco threw wild to first, another run scored.
In the second inning, Beltran surprised the Marlins by bunting for a hit to load the bases with no outs. Delgado followed with a sacrifice fly.
A throwing error by second baseman Alfredo Amezaga sent another unearned run home in the third to make it 6-0.
In the sixth, Ramirez hit his 11th home run and Cabrera added his 17th. Cabrera's two-out, two-run single in the seventh cut the deficit to 6-5.
"We keep fighting," Ramirez said. "It's 27 outs."
Floyd argued after being called out on strikes in the ninth by umpire Andy Fletcher and was ejected when he threw his bat. ... The Mets have scored 98 runs in the first inning, an average of almost one per game. ... The Marlins have 13 home runs in the past six games.