For the second straight game, the Marlins rallied late to claim a one-run victory. They scored four times in the ninth inning on Sunday to edge the Phillies, 5-4, at Citizens Bank Park.
Steve Cishek logged his 36th save in 40 chances, and Miami moved two games ahead of the Mets for third place in the National League East.
"We knew going in that it was going to be a battle for us," manager Mike Redmond said. "No doubt, to win that last game in Philly, I was really hoping that was going to be able to energize us before the seventh inning. I give deGrom a lot of credit for the way he pitched. He's got quality stuff, and [he] is going to be a great pitcher in this league for a long time. But we did battle. We scored our runs when we did."
Because the Nationals beat the Braves, Miami's elimination number to win the National League East drops to one. But the Marlins are clinging to National League Wild Card hope.
Now 73-76, the Marlins are also motivated in the aftermath of All-Star Giancarlo Stanton being out of action since last Thursday, when he was struck in the face by a fastball in Milwaukee. Stanton's No. 27 jersey is being displayed in the dugout.
"Obviously, G's still not here," Marlins starter Jarred Cosart said. "Everyone can joke about it or whatever, about that jersey in the dugout, but it means a lot to us. He was the heart and soul of this team.
"We feel like he's still in there. We feel like we owe him something to go out there and play our best when he isn't out here with us. We're only going to be better when we do have him."
Cosart gave up two runs with five strikeouts in six innings. Over his last six starts, the Miami right-hander is 3-1 with a 1.79 ERA, but he wasn't involved in the decision.
An NL Rookie of the Year frontrunner, deGrom struck out a career-high 13 in seven innings.
Despite being dominated most of the night, the Marlins rallied for three runs in the seventh to claim a 3-2 lead.
But New York capitalized on Casey McGehee's error on pinch-hitter Eric Campbell's slow grounder that opened the door for three runs (one earned), also in the seventh. Mike Dunn issued a walk, followed by an RBI single to Daniel Murphy. A.J. Ramos faced four batters, walked three and gave up the go-ahead double to Travis d'Arnaud.
The game swung back in the Marlins' favor for good as they scored three times in the eighth inning. Adeiny Hechavarria had a two-run single off Jeurys Familia and Mathis delivered a two-out RBI single to right off Jenrry Mejia, putting Miami in front by a run.
The game came full circle for Mathis, because he was deGrom's eighth strikeout when he fanned for the second out in the third inning. But in the eighth, the Miami catcher delivered the game-winning hit.
"The guy had good stuff," Mathis said. "He came out with some life on everything, but you've got to put it behind you and keep going. That's what we did."
The three runs Miami scored in the seventh snapped deGrom's streak of 28 straight innings without allowing an earned run.
Before the first three innings were completed, deGrom achieved a piece of MLB history. The 26-year-old's strikeout streak matched a modern-day big league record initially set by Jim Deshaies of the Astros on Sept. 23, 1986, against the Dodgers.
"That's about as dominating a start of a game as I've probably ever seen, and I've seen some pretty good pitching," Mets manager Terry Collins said.
To start off a game, the Marlins had never fanned as many as five straight times. The club record previously was four, done five times overall, with the most recent being July 4, 2013, at Atlanta.
"We've been making games interesting at the end," Mathis said. "I'm happy about the way we came back, played and battled. It was fun to be a part of."