DeGrom (2-0, 1.62 ERA) allowed two hits and walked none in his third start after spending the first part of the season on the injured list. He has yielded six hits, struck out 28 and issued one walk in 16⅔ innings so far this year.
"You don't really know what to expect coming back, but last time out I was able to look at a couple of things where I felt I was getting off mechanically and try to make those adjustments while I was going through a pretty slow process of coming back,'' deGrom said. "That seems to have paid off a little bit.''
The two-time NL Cy Young Award winner opened the game by striking out Bryson Stott looking on a 101.1 mph fastball and then allowed a soft single to Rhys Hoskins. After Alec Bohm grounded into a force play, deGrom fanned J.T. Realmuto on three straight sliders.
DeGrom has struck out 28 of the 56 batters he has faced this season. That 50% strikeout percentage is the highest by any pitcher through his first three starts of a season since the mound moved to its current distance in 1893, according to ESPN Stats & Information research. DeGrom held the previous high, striking out 48.6% of batters to start last season.
"He's doing great,'' Diaz said. "He can do everything he wants with the hitters.''
With the win, deGrom improved to 9-1 in 20 career starts against the Phillies.
Pete Alonso hit an early RBI single as the NL East leaders improved to 31-9 following a loss and 10-4 in the season series with Philadelphia. Alonso leads the NL with 97 RBIs.
Diaz issued two walks in the ninth, and Philadelphia had runners on second and third when Nick Castellanos struck out swinging for the final out. It was Diaz's 27th save of the season.
The All-Star closer became the sixth active pitcher to reach 200 saves.
"It's awesome,'' deGrom said. "He's done a great job and you're comfortable any time he's in the game.''
The Mets posted their MLB-best 15th shutout. It was their first 1-0 win over Philadelphia since R.A. Dickey tossed a one-hitter exactly 12 years ago at Citi Field.
"The star of the show was our pitching staff,'' Alonso said.
Philadelphia wasted a terrific performance by Aaron Nola (8-9), who allowed four hits in eight innings. The right-hander struck out eight and walked one, but he dropped to 0-3 in four starts against New York this year.
The Phillies finished with three hits.
New York jumped in front in the first. Starling Marte singled, stole second and took third on a throwing error by Realmuto before scoring on Alonso's soft single to right.
"Facing deGrom, you know it's going to be low [scoring],'' Nola said. "So it's just going to be a battle all night. And it was.''
The Associated Press contributed to this story.