The Mets avoided a sweep with their sixth win in 23 games.
Pelfrey (7-10) allowed three runs and nine hits. He nearly caused benches to empty in the sixth when he took exception to the way Placido Polanco turned away from an inside pitch. Pelfrey, who has a history of hostility toward the Phillies, motioned toward Polanco, who said something back. Catcher Josh Thole stepped in front of Polanco and the confrontation didn't escalate.
Bobby Parnell pitched a scoreless ninth for his first save this season and second in his career. He retired Carlos Ruiz on a grounder with two runners on to end it.
Phillies starter Kyle Kendrick (7-6) gave up six runs - two earned - and seven hits in four innings filling in for Cole Hamels.
The major league-leading Phillies entered 6.5 games ahead of Atlanta in the NL East. That lead, which was 9.5 games on Aug. 6, could be down to five by the time Philadelphia opens a three-game series against Florida on Friday night. The Braves had two more games at the Chicago Cubs before visiting the Mets on Friday.
The Mets jumped on Kendrick in the first, scoring four unearned runs with the help of a fielding error by shortstop Michael Martinez. Angel Pagan led off with a single. Ruben Tejada followed with a sharp grounder to Martinez that could've been a double play. But Martinez bobbled it and both runners were safe. Wright singled to load the bases and Pagan scored on Lucas Duda's fielder's choice grounder to second. After Jason Bay struck out, Evans hit a three-run shot to left.
Martinez, filling in for the injured Jimmy Rollins, started his second game at shortstop. He's started 24 games at second base and third base this season.
The Phillies answered with three runs in the second. Shane Victorino hit a two-run single with two outs, extending his hitting streak to 12 games. After Polanco singled, Chase Utley's RBI single got the Phillies within a run. Ryan Howard walked to load the bases, but Pelfrey retired Hunter Pence on a fly to right to end the inning.
Wright led off the third with an opposite-field drive to right to put the Mets ahead 5-3. It was Wright's 15th career homer at Citizens Bank Park, his most at any road stadium. Wright's sacrifice fly in the fourth extended the lead to 6-3.
Pence's RBI infield single in the seventh cut it to 7-4. The Phillies had runners at first and third with one out in the eighth against Manny Acosta when second baseman Justin Turner started a double play with a diving, back-handed grab on Polanco's grounder up the middle.
Notes: The Mets placed Jonathon Niese on the disabled list with a ribcage injury. ... Pelfrey improved to 7-6 against the Phillies. ... The Mets have lost all five series against the Phillies this season, but haven't been swept. ... Mets SS Jose Reyes (hamstring) will begin a rehab assignment at Double-A Binghamton on Thursday. ... Howard was back for the Phillies after sitting out a game because of a heel injury. .. Phillies LF Raul Ibanez remained out because of a sore groin. ... A crowd of 45,689 was the 203rd straight sellout for the Phillies, including postseason play. ... The Phillies are off on Thursday before opening a three-game series at home against Florida on Friday night. Roy Oswalt (6-7, 3.51) takes the mound against the Marlins. ... The Mets return home for a three-game set against Atlanta, starting Friday. Chris Capuano (9-11, 4.71) pitches the opener.