The scene was familiar. The fondness for the memories had faded.

It was the ninth inning. Two outs. The game-tying run on third. The go-ahead run on second. The Citi Field crowd on its feet, hating to see who stood at the plate — Wilmer Flores.

“We’ve all seen him do it plenty of times,” Zack Wheeler said of his longtime teammate. “It was a little nerve-wracking.”

Cheered before multiple at-bats during the series, the former Mets infielder faced Justin Wilson, sporting an awkward-looking Diamondbacks jersey, and owning the most walk-off RBIs ever at Citi Field.

“That was going through my mind. I promise you,” manager Mickey Callaway said. “I’ve seen it. He’s done it more than anybody in the history of Citi Field, so it was going through my mind. There was no doubt about it.”

Once again, Flores made the stadium erupt, going down swinging on the final pitch of Wilson’s four-out save, and giving the Mets a 3-2 win.

With their second straight win over a team which had gone 11-2 in their previous 13 games, the Mets have won four of six games since last week’s ninth-inning meltdown in Washington.

With the victory, the Mets moved to within three games of the Cubs for the second wild-card spot in the NL, but they also are still behind the Brewers, Phillies and Diamondbacks.

Another potential nightmare appeared to loom Tuesday night. Wilson’s pitch count was rising. Edwin Diaz was warming up in the bullpen.

But Callaway had no desire to hand the ball to last year’s major league saves leader, acquired in the offseason for such moments.

“I just had to [stick with Wilson]. We all know the struggles that Diaz has had and Wilson has been really good. I felt like at that point it was Wilson’s [game],” Callaway said. “He willed it. I’m not saying we’re going to run from Diaz. He’s going to get his chances, too … but we called down in the eighth and asked Wilson if he could get four outs for us.

“He didn’t have his best stuff. He didn’t have his best command, but he dug deep and got through it. He’s going to need a day or two off, but it’s worth it for the win tonight. He was unbelievable. He kind of willed that game, that save.

“I thought Wilson was going to get it done. Some way, somehow.”

After Todd Frazier drove in three runs, and Zack Wheeler (11-7) pitched seven innings, of one-run ball — marking his longest start since Aug. 6, and third straight outing allowing just one run — Callaway brought on Brad Brach, who served up a solo homer in the eighth to Eduardo Escobar.

With Seth Lugo unavailable after pitching two innings the previous night, Callaway called on the only other reliever he can trust. Wilson, who has a 1.54 ERA since the All-Star break, made his first four-out appearance since recording his only other save on April 2.

“Late in the season, everything kind of goes,” Wilson said. “Clearly we’re still in a little bit of a hole. Luckily we have enough games left to make a push. Everyone’s available in any situation.”

Wilson ended the eighth by stranding a runner on second. Then, the ninth opened like so many others for the Mets this season.

After a pair of Arizona singles put runners at the corners, Ketel Marte nearly hit into a game-ending double play. Pete Alonso stepped on first base — following a diving backhand stab — but the rookie threw to third base, failing to notice Tim Locastro caught between first and second base.

“Young guy, you don’t know what he’s going to do, and he kind of spazzed out,” Frazier said. “Could’ve had a double play, but your mind’s going a mile a minute.”

Then, every mind shared the same thought, watching the beloved former Met come to the plate. Wilson, the first-year Met, perhaps the only person present unaware of Flores’ theatrics.

“Nice,” Wilson said. “Glad he got out.”

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.