Domonic Brown then hit a double, but the 3 hour and 35 minute game ended when Darin Ruf lined out to second.
Cole Hamels allowed three runs during a 35-pitch first inning and the Phillies never recovered, falling back to .500 at 49-49.
Jimmy Rollins hit the third pitch of the game off rookie Zack Wheeler for a home run to right field. Rollins had gone 161 at-bats since his last home run on May 31, the fifth longest drought of his career.
Mets second baseman Daniel Murphy hit a one-out double in the first inning, extending his hitting streak to 10 games. After being down 0-2, David Wright drew a walk, with Murphy stealing third on ball four.
Former Phillie Marlon Byrd then tied the game with an RBI single to left. Later in the inning Juan Lagares' bloop one-out single to shallow right gave the Mets a 2-1 lead.
Phillies third baseman Michael Young missed a chance at getting an inning-ending double play when after fielding a grounder by catcher Anthony Recker, he momentarily had trouble getting it out of his glove. Young got the force at second, but the hesitation enabled Recker to beat Utley's throw to first. Byrd scored the third run on the play.
The Phillies loaded the bases to start the fifth on singles by Hamels and Rollins and a walk to Michael Young. Utley then hit a sacrifice fly to left for the second run. Brown flew to center on a 3-0 pitch for the second out. Ruf walked to load the bases and that ended Wheeler's day, after 106 pitches, just 58 for strikes.
Righthander Gonzalez Germen came in relief and ended the inning by striking out Delmon Young on a change-up.
David Wright's RBI single up the middle extended the Mets lead to 4-2 in the fifth.
Hamels was pulled for a pinch hitter in the sixth. He allowed four runs (all earned) in five innings on seven hits with five strikeouts and two walks. In his previous three starts, Hamels had allowed one walk in 23 innings.
The Mets scored their fifth run on Murphy's RBI bloop single in the seventh inning.
Contact Marc Narducci at email@example.com. Follow @sjnard on Twitter.