Some fans at Citi Field wore ponchos. Some wore hoodies. Some held hot coffee. Some held hands.

And at the end of this dark, damp, windy Friday night in Queens, some left believing it might not be their only brush with fall baseball.

Returning to Citi Field for the first time since deflating back-to-back sweeps by the Braves and Cubs, the Mets opened their 10-game homestand by recovering from Edwin Diaz’s latest ninth-inning debacle and pulling out their latest dramatic win, 5-4, over the similarly desperate Phillies, on Pete Alonso’s two-out, bases loaded walk.

By notching their second straight win since Tuesday’s historic meltdown in Washington, the Mets pulled even in the standings with Philadelphia and moved within four games of the Cubs for the National League’s second wild-card spot, following Chicago’s loss.

“We pick each other up probably better than anybody. It’s a special trait that this team has,” manager Mickey Callaway said. “What we’ve been through this year, if we can get in the playoffs, I like what we’re gonna be able to do because we’re gonna have a uniqueness to us that’s going to be very valuable in the postseason.”

Again, Diaz nearly destroyed the dream.

After the Mets broke a tie with a pair of runs in the bottom of the eighth — jumping ahead on an Alonso RBI single — Callaway turned to Diaz, who was attempting to earn his first save since Aug. 15. Instead, the disastrous offseason acquisition predictably turned the crowd against him, giving up a game-tying two-run homer to J.T. Realmuto.

It was the 14th home run allowed this year by last season’s saves leader, tying him for the record for the most ninth-inning homers allowed in a season since 1900.

“I think it’s been a lot of bad luck,” Diaz said with a straight face. “I thought I did a pretty good job. It was just the one mistake that I made.”

At this point, one mistake could mean the season’s end.

When the Mets’ first two hitters were retired in the ninth, the demoralized crowd appeared set to suffer through extra innings. Then, .204 hitter Juan Lagares extended the inning with a single. Then, J.D. Davis came off the bench with a hit. Then, Jeff McNeil was hit by a pitch.

Then, the major league’s home run leader stepped to the plate.

“I’m sure the pitcher’s like, ‘Oh no, it’s Pete Alonso coming up,’ ” Callaway said.

The NL Rookie of the Year front-runner took the first two pitches from Nick Vincent. Alonso then took a massive cut, coming up empty. The fourth pitch went foul. The fifth went low.

“The pressure’s on him at that point,” Alonso said. “He’s got nowhere to go. He had to come to me at that point.”

Vincent fired high, and the Mets’ mightiest bat remained on Alonso’ s shoulder. Lagares ran home, following the Mets’ first walk-off walk in a decade. Alonso ran to first with his NL-best 30th go-ahead RBI.

Then, Alonso was treated to the tradition he created, with his jersey ripped off in the celebration, leaving him shirtless and smiling and soaked with various liquids.

“I was forewarned. I knew it was coming, so I just let it happen,” Alonso said. “It’s a fun thing. Hopefully I can rip some more shirts off, and they can rip some shirts off me by the end of this thing.”

When disaster and euphoria are separated by minutes, four games in three weeks seems within reach.

“This one would’ve been a huge loss,” Todd Frazier said. “Series are good to win, but we gotta think sweep, and we gotta think sweep a lot. In this situation, things have been crazier before where guys came back in September. It’s very doable but we gotta win.”

Purchase event tickets to The Amazin’ 1969 New York Mets: A World Championship for the Ages presented by The Paley Center for Media and New York Post. Enter promo code: NYPOST to unlock tickets only available for Post readers.