Pete Alonso of the Mets celebrates his ninth-inning walk-off walk against...

Pete Alonso of the Mets celebrates his ninth-inning walk-off walk against the Phillies with his teammates at Citi Field on Friday. Credit: Jim McIsaac

It’s easy to imagine all the ways this Mets season already is doomed. There still are two teams between them and a wild card spot. They lost that disastrous game to the Nationals earlier this week — a psychological gut punch that could very well sting them in the long run. And the bullpen is . . . well, the bullpen, something they aptly demonstrated Friday night when Edwin Diaz suffered his seventh blown save.

And yet.

Nights like Friday also show that there’s still a spark left in this team. It was there in the ninth inning, when after the Phillies tied the score on J.T. Realmuto’s two-run homer off Diaz, the Mets loaded the bases after two were out. And it lived in Pete Alonso’s at-bat, as he patiently watched ball after ball go by, resisting the urge to swing.

That same spark ended up ripping a current through Citi Field after Alonso drew a full-count walk, driving in the winning run as the Mets beat the Phillies, 5-4.

The Mets were up 4-2 in the ninth when Diaz allowed a single by Jean Segura and served up a fat slider down the middle to Realmuto, who hit it far and deep into the leftfield seats to tie the score. But instead of a dispiriting loss, the fans got treated to another celebration. Alonso got his shirt ripped off — a tradition he started — though he couldn’t tell who did it in the deluge of sunflower seeds and Gatorade.

“Hopefully I can rip some more shirts off and they can rip some shirts off me,” he said.

The Phillies’ Mike Morin picked up two quick outs in the ninth on pop-ups, but Juan Lagares and J.D. Davis singled and Nick Vincent hit Jeff McNeil with a pitch to load the bases for Alonso, who picked up his 107th RBI.

RBI singles by Alonso and Wilson Ramos had produced a 4-2 lead in the eighth that Diaz gave back.

The Mets are tied with the Phillies and Brewers, 1 1⁄2 games behind the Diamondbacks and four games behind the Cubs in the battle for the second wild card. This could be a defining homestand for this club: first the Phillies and then the two best teams in the NL West, the Diamondbacks and Dodgers.

“We gotta win a lot of games,” said Todd Frazier, who recorded his 1,000th hit and admitted to peeking at the scoreboard, watching the progression of the Brewers-Cubs game with interest (the Brewers won).  “We can’t just sit back. This one would have been a huge loss. Every single game is big . . . Series are good to win, too, but at the same time, we’ve gotta think sweep, and we’ve gotta think sweep a lot.”

The difficulty level, though, is high. The Mets need Diaz to produce, but he can’t seem to right the ship. On Friday, he seemed to be cruising until the mistake to Realmuto. His ERA shot up to 5.88 and he’s allowed 14 homers, all in the ninth inning. According to ESPN stats, that’s the most such homers allowed in a season in baseball history, tied with Francisco Rodriguez. The Mets have allowed 31 ninth inning homers, the most in MLB history.

Seth Lugo wasn’t available — a needed rest day, Mickey Callaway said. Their next best option, Justin Wilson, already had pitched.

“Diaz has to be good for us to get to where we want to go,” Callaway said. “We’ll continue to run him out there in those situations when Lugo is not available or Wilson is not available, and if he doesn’t get the job done, then we won’t get the job done.”

Diaz (2-7) actually struck out the side in the ninth. “Today I thought I actually did a pretty good job, but it was just that one mistake that I made,” he said through his interpreter. “I think it’s been a lot of bad luck.”

Frazier singled to lead off the third and scored on McNeil’s two-out single. Michael Conforto hit his career-high 29th homer to lead off the fourth, but Realmuto cut the deficit in half in the fifth with an RBI double. Rhys Hoskins walked to lead off the sixth and scored on a two-out double by Maikel Franco.

The Mets bounced back from that, though. Then they bounced back again in the ninth.

Resilience, Alonso said, “is of the utmost importance because not everything is going to go to plan. Sometimes you’ve got to punt the playbook and just play baseball.”

More on this topic
DON'T MISS THIS LIMITED-TIME OFFER1 5 months for only $1Save on Unlimited Digital Access