This pit of scorching snakes was no match Monday night for the world’s greatest Polar Bear exhibit.

As well as the Diamondbacks have played over the past two weeks to surge into serious NL wild-card contention, there are just games Pete “Polar Bear” Alonso places this Mets lineup on his back and refuses to let it fail.

On this night the slugging first baseman cleared the left-field fence twice, giving Jacob deGrom the necessary runs in a 3-1 victory at Citi Field that snapped the Mets’ two-game skid. The Mets entered the night four games behind the Cubs — who played later in San Diego — for the NL’s second wild card.

Alonso, with homers No. 46 and 47, moved two ahead of Mike Trout for the major league lead, as the Angels began play Monday. Also, Alonso now only needs six homers to break the MLB rookie record established by Aaron Judge in 2017.

“Really, the [biggest] thing, I just want to make the playoffs,” Alonso said, when asked about the home run pursuits. “That is something we still have a chance to do and I still think making the playoffs would be the most rewarding experience ever. From where we have come so far this year, to be able to make it and have a chance to play for a ring, that would surpass any personal records.”

Alonso’s second solo blast of the night against Merrill Kelly gave the Mets a 3-1 lead in the fifth. The multi-homer game was Alonso’s fourth of the season, but first since May 29 at Dodger Stadium. With his first-inning homer, Alonso established a single-season franchise record by reaching base in a 34th straight game.

“When they throw him strikes, he is going to hit the ball hard, that is first and foremost,” manager Mickey Callaway said. “There has got to be some anxiety when the pitcher is having to face Pete, so if he doesn’t get on via hit he’s getting on via walk. He is just a great hitter.

“I’m impressed every day by Pete and I know everybody else is. Man, he’s pretty good.”

DeGrom resumed his hunt of a second straight NL Cy Young Award by allowing one run on three hits over seven innings with 11 strikeouts. The double-digit strikeout game was deGrom’s ninth this season.

“That’s Cy Young vintage Jake deGrom right there,” Alonso said. “He’s a guy we love having on the mound and we kind of fed off the way he pitched tonight. It was awesome.”

It was a rebound for deGrom (9-8), who had allowed four runs in each of his past two starts, against the Cubs and Nationals, respectively. Against the Nationals last week, he watched the Mets bullpen squander a six-run lead in the ninth inning to lose 11-10. This time Seth Lugo pitched two perfect innings to preserve the victory.

Wilmer Flores returned to Flushing with a bang, launching a homer to left leading off the fifth against deGrom to pull the Diamondbacks within 2-1.

Flores was playing his first game at Citi Field since he was non-tendered by the Mets last December. The homer was Flores’ eighth this season — he entered play with a .415 batting average since Aug. 1, which ranked first in the major leagues among players with at least 50 plate appearances over that stretch.

Amed Rosario had extended the Mets’ lead to 2-0 with an RBI single in the fourth against Kelly. Wilson Ramos doubled leading off the inning and

Brandon Nimmo was intentionally walked with two outs before Rosario delivered.

Only helping Alonso’s homer pursuit, the Mets will travel to two of the hitter-friendliest ballparks in MLB on their next road trip in Colorado and Cincinnati.

“I’m looking forward to it, but on that same token it’s really important to capitalize on pitches in the zone, not chase and really not put too much pressure on myself,” Alonso said. “I just need to take quality swings at pitches over the plate.”

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.