Davis hit an RBI double in the first inning and added a two-run, seventh-inning single for the Mets, who evened their three-game series against the Phillies.
Jose Reyes socked a solo homer and Jesus Feliciano chipped in a pair of hits and scored twice for the victors.
Pelfrey (14-9) held Philadelphia to two runs on six hits, walking none and fanning five to pick up the win. Hisanori Takahashi notched his sixth save with a scoreless ninth after the Phillies scored three runs in the eighth to make it close.
Kyle Kendrick (9-9) absorbed the loss, which broke Philadelphia's four-game winning streak. Kendrick surrendered a pair of runs on five hits in five innings.
The first-place Phillies entered the game with a one-game lead over Atlanta in the National League East.