Daniel Murphy hit a go-ahead, two-run double in the 13th inning after making a spectacular defensive play to end the 10th, leading New York to its seventh straight victory, 9-5 on Thursday night.
Reliever Carlos Torres led off the 13th with a single to center, went to second on Curtis Granderson's single to left and they both scored on Murphy's opposite-field hit off Hector Neris (2-2). Helped by two errors by Neris, the Mets scored two more runs in the inning.
Murphy sent the game to the 11th with a tremendous defensive play. Jeff Francoeur's hard liner deflected off Torres' leg toward first base. Murphy made a diving stop before flipping a no-look toss toward the bag that was caught by the hustling Torres, who beat Francoeur by a half-step.
"You'll see it tonight if you turn on your TV," Mets manager Terry Collins said. "It will be shown many times."
Darin Ruf went deep for the Phillies, who have dropped 12 of 13 to the Mets this year and 29 of the last 36. The Mets outscored the Phillies 40-21 during the four-game sweep.
"I'm happy they're leaving town," Phillies interim manager Pete Mackanin said.
The game took 4 hours, 32 minutes.
Philadelphia had a chance to win it in the 12th, but third baseman David Wright made an excellent defensive play on Andres Blanco's chopper with two outs and Cesar Hernandez coming home from third. Wright charged the ball, fielded it on a short hop and then gunned down Blanco to keep the Mets' hopes alive.
The Phillies scored five runs in the third to open the game's scoring.
Francoeur's two-run single and Ruf's opposite-field shot off Jonathon Niese highlighted the inning. Niese entered 5-0 with a 1.61 ERA in his last seven games against the Phillies, but he got a no-decision after allowing five runs and five hits in six innings.
But the Mets came back with two runs in the fourth on Travis d'Arnaud's opposite-field drive before tying the game in the fifth on Yoenis Cespedes' two-run homer to right and Kelly Johnson's solo shot to right. All three homers came off Aaron Harang, who gave up five runs and nine hits in six innings. Harang entered tied for the most losses in baseball with 14.
The Mets thrilled the large contingent of New York fans with the ninth straight win over Philadelphia. New York remained 6 1-2 games ahead of Washington, a 4-2 winner over San Diego, in the NL East.
"We just had a tough time keeping them off the scoreboard," Francoeur said. "Those guys, give them credit, they're swinging the heck out of the bats."
Torres (5-5) pitched 2 1-3 scoreless innings, allowing one hit and striking out one.
New York has averaged 10.4 runs during their winning streak.
The Mets set a franchise record for homers in a month with 43.
In the second inning, a woman sitting five rows off the field was hit in the forehead by a foul ball off the bat of Freddy Galvis of the Phillies. The team said she was evaluated and didn't need to go to a hospital.
Commissioner Rob Manfred talked at Citizens Bank Park before the game and said there was a chance that extra safety nets could be put up around the majors as early as next season.
Phillies: Catching prospect Jorge Alfaro singled and caught three innings in a rehab start for the Gulf Coast League Phillies on Thursday. One of the prospects acquired from Texas in the Cole Hamels trade, Alfaro had been sidelined since June 11 with a left ankle injury. ... LHP Elvis Araujo left with a left groin strain after throwing one pitch to Cespedes, the second batter he faced, in the 11th.
Mets: New York opens a three-game home series against Boston on Friday night with RHP Matt Harvey (11-7, 2.57) facing Red Sox LHP Henry Owens (2-1, 4.50). Harvey is 4-0 with a 1.11 ERA in his last 7 starts at Citi Field dating to June 16.
Phillies: Rookie RHP Aaron Nola (4-1, 3.59) takes the mound for Philadelphia in the first of a three-game home series against San Diego on Friday night. Nola pitched eight shutout innings, allowing three hits, in his last start in Sunday's 2-0 win at Miami. RHP Ian Kennedy (8-11, 4.01) starts for the Padres.