"It just kind of felt like we were waiting for our moment. Just a matter of time," Howard said.
Hamels (7-2) recovered from a shaky start to retire his final 11 batters -- five by strikeout -- without allowing a ball out of the infield. He struck out a season-high 10 and walked none over seven innings to win his third straight outing and improve to 3-9 in 15 career games against the Mets.
The left-hander had lost five consecutive starts against New York.
"It's good. Got to have it sometime," he said.
Jose Contreras worked a perfect eighth and Ryan Madson got three quick outs for his 11th save in as many tries. Philadelphia pitchers set down the last 17 Mets after Ronny Paulino's fourth-inning single.
Jimmy Rollins and Chase Utley sparked another late rally for the Phillies, who scored three times with two outs in the eighth after Pelfrey was lifted. The NL East leaders have won four straight and eight of 11.
"Back-to-back late-inning wins, it's great for us," Hamels said. "To get 'em late in the game, you build confidence off that, knowing you can never count our team out."
Jose Reyes stole two bases and scored twice for the Mets, who have dropped six of seven after coughing up an eighth-inning lead for the second consecutive night. New York has lost all three series against the Phillies this year, falling to 2-11-1 in series with them since 2009.
Pelfrey took a three-hitter into the eighth and received some defensive help when Angel Pagan, activated from the disabled list Friday, dashed into right-center and went to his knees for a tumbling catch to rob John Mayberry Jr. of a leadoff hit.
Pelfrey had retired 12 straight when Rollins chased him with a two-out single on his 116th pitch. The crowd of 29,337 gave the big right-hander a rousing ovation as he walked off the mound, but those cheers soon turned to boos.
New York let Rollins steal second easily and Mike O'Connor (0-1) gave up a two-strike single to Utley, tying the score at 2.
"I felt fine and being a competitor, you never want to come out. But he made a decision to do that and I completely understand it. Like I said, 90 out of 100 times, it works out. Tonight was one of those nights it didn't work out," Pelfrey said. "There were times earlier in the year when I was off and the bullpen had to pick up seven or eight innings, whatever it was. We're in this together and we're going to get this turned around."
Placido Polanco drew a walk from Jason Isringhausen, and Mets manager Terry Collins tried his third reliever of the inning when he brought in left-hander Tim Byrdak to face Howard, who was batting .186 with 25 strikeouts in 70 at-bats against lefties this year.
The slugger lined a 2-0 slider into the right-field corner to put Philadelphia up 4-2.
"When he gets some hits on those guys, we become very good. Our offense definitely picks up," manager Charlie Manuel said.
For the second night in a row, the Phillies overcame an eighth-inning deficit against New York's suddenly struggling bullpen. Mets relievers have a 12.46 ERA in the last six games.
"There are about four games in the last 10 or 11 where we're had a really well-pitched game and haven't scored enough to get the job done, and it's tough when you waste good pitching like this," Collins said.
Reyes got the Mets off and running with a leadoff double in the first inning. He stole third and scored on Justin Turner's single up the middle.
That gave Turner 19 RBIs in 80 big league at-bats this season -- one more RBI than Mets star David Wright has in 146 at-bats. Wright is on the disabled list with a back injury.
Reyes also singled and stole second in the third before scoring on a two-out single by cleanup batter Jason Bay, who improved to 4 for 29 (.138) with runners in scoring position.
New York stole a season-high five bases, all in the first three innings -- including one by Pagan. He tried to swipe third as well, but Hamels wised up and spun around in time for an easy pickoff.
Phillies closer Brad Lidge (strained rotator cuff) threw 24 pitches in an extended spring training game, tossing a scoreless inning with one strikeout. ... CF Shane Victorino, on the DL with a strained right hamstring, began his rehab assignment at Class-A Lakewood. He played five innings and went 1 for 2 with two RBIs. ... A warm cheer went up after highlights of Gary Carter's career with the Mets were shown on the big video board, followed by a written message: "Our thoughts are with you Gary. Best wishes for a speedy recovery." The Hall of Fame catcher has a brain tumor that doctors said is likely cancerous.