Wilmer Flores touched first base, tossed his helmet aside, then braced for the rush of humanity. For the Mets, there was plenty to celebrate.

They had squandered a gem by Jacob deGrom and suffered an unsightly bullpen meltdown, all in the space of four pitches. But in the 10th, Flores washed it all away, lining a slider to score Juan Lagares and push the Mets to a 5-4 victory over the Phillies Tuesday night.

"It's a good feeling obviously because we got the win," said Flores, who also lifted a game-tying sacrifice fly in the eighth. "It's always a good feeling."

Flores' winner offered the Mets redemption after a nightmarish eighth inning. They began the frame with a 3-0 lead behind deGrom, who had tossed a shutout to that point. They ended it trailing 4-3, after three Mets relievers conspired to deprive deGrom of a win.

Still, the Mets endured.

"It's definitely a good feeling," said deGrom, who was charged with two runs in 71/3 innings. "The most important thing is that we got the win."

After absorbing a three-game sweep against the Pirates -- a showing that prompted manager Terry Collins to call a team meeting -- they will go for a three-game sweep of the Phillies on Wednesday.

"Good game for us to hang in there and come back and win," Collins said.

One start after his one-hit, eight-inning, 11-strikeout masterpiece against the Cardinals -- the best pitched game by a Met in the last two seasons -- deGrom put up a string of zeros against the Phillies. At one point, he retired 11 straight.

In the fourth, Michael Cuddyer delivered a two-run single and Lucas Duda singled in a run. The way deGrom was cruising, the 3-0 lead looked to be enough.

After getting Odubel Herrera to fly out in the eighth, deGrom had not let up a run in 151/3 innings. But Carlos Ruiz and Cesar Hernandez unleashed back-to-back singles and deGrom was pulled after 105 pitches for Hansel Robles.

The 24-year-old quietly has climbed the Mets' bullpen hierarchy. In 10 appearances, he had posted a 2.89 ERA. And the day before, he got two outs in the eighth inning to help the Mets protect a three-run lead.

On Robles' second pitch, Ben Revere smoked a triple to right-center, driving in two runs. On Robles' fourth offering, Freddy Galvis singled through a drawn-in infield to tie it at 3.

The mood darkened further when rookie Maikel Franco singled in the go-ahead run off Carlos Torres.

From there, the Mets regrouped. Flores tied it with the sacrifice fly in the eighth. In the ninth, catcher Kevin Plawecki uncorked a perfect throw to keep Herrera from swiping second as the potential go-ahead run.

For the first time this season, the Mets turned to closer Jeurys Familia for two innings. He responded by putting up a pair of zeros.

Flores made it count when he lined Elvis Araujo's slider into the outfield.

"Obviously, we had a rough eighth inning," said Flores, who hit a go-ahead, three-run homer Monday. "But we kept pushing and we wouldn't give up."

On May 15, Flores committed his ninth error, bringing more attention to his deficiencies on defense. They were compounded by his struggles at the plate.

But he hasn't committed an error since. In his last 13 games, he's hitting .280 with three homers and 11 RBIs.

Said Flores: "I'm right where I need to be."