MIAMI -- The game was as tight as the NL East standings, and at the end of the night, the Philadelphia Phillies led both.
"We sweated every bit of it out," Phillies manager Charlie Manuel said. "It seemed like a long mental test."
The Phillies' eighth win in the past nine games left them with a half-game lead over the Mets, who lost to Atlanta 4-2. Philadelphia ended the Marlins' nine-game winning streak and dealt a blow to their faint playoff hopes.
Joe Blanton (3-0) struck out nine in five innings and left with a 3-2 lead. Ryan Madson escaped a two-on, no-out jam in the eighth, and Brad Lidge stranded a runner at second in the ninth for his 39th save in 39 chances.
"The bullpen as a whole was outstanding," Lidge said. "I'm a little biased, but I think that's what won the game tonight."
Florida went 1-for-12 with runners in scoring position and struck out 16 times.
"We couldn't get that big hit when we needed it," said outfielder Cody Ross, who went 0-for-4.
Shane Victorino hit his second homer of the series and 14th of the season for a 2-all tie in the fourth, and the Phils took the lead for good in the sixth on Gregg Dobbs' run-scoring single.
The Marlins fell five games back in the wild-card race and have only eight games left.
"As many teams as we can weed out is OK with us," Dobbs said.
Said Ross: "There's no reason to hang our heads. We still have a chance."
Anibal Sanchez (2-5) departed after 5 2/3 innings because of a cramp in his right hamstring. With the score 2-all, Sanchez walked consecutive batters in the sixth, then gave up a two-out RBI single by Dobbs.
Sanchez fell to 0-4 in five career starts against the Phillies with an ERA of 8.72.
Marlins rookie Cameron Maybin singled and scored but also struck out four times, dropping his average from .818 to .625.
From there, Blanton and four relievers shut out Florida over the final 6 2/3 innings. J.C. Romero struck out Maybin and Baker to strand two runners in the seventh, and Madson escaped even more serious trouble after Jorge Cantu singled and Mike Jacobs doubled to start the eighth.
Third baseman Dobbs fielded a grounder and threw home to get Cantu. Following a groundout, a 2-2 pitch appeared to hit Ross on the hand, but umpire C.B. Bucknor ruled the play a foul ball, saying the pitch hit the knob of the bat handle. The Marlins argued briefly, and after three more foul balls, Ross struck out to end the inning.
"The ball hit my hand, but that's a tough call for him," Ross said. "You can argue all you want, but you have to get back in there and get an at-bat."
Amezaga walked to start the ninth and stole second as Dallas McPherson struck out. Lidge also struck out Maybin and Baker to close out the 3½-hour win.
"I was disappointed I walked the leadoff guy," Lidge said. "But I still believed I was going to get out of it."
Florida SS Hanley Ramirez (shoulder) missed his third game in a row and won't rejoin the lineup until Monday at the earliest, the team said. ... LHP Jamie Moyer, scheduled to start Sunday for the Phils, has won all five career starts in Miami with an ERA of 1.60. ... Foul tips twice hit Bucknor in the face mask, and he took a three-minute timeout in the ninth when it happened the second time.