Jay Bruce after his 12th-inning walk-off single to beat Milwaukee...

Jay Bruce after his 12th-inning walk-off single to beat Milwaukee at Citi Field on Tuesday, May 30, 2017. Credit: Jim McIsaac

For every calamity, there is a comparison. Such is the reality for those who close their eyes, hold their breath, and hope for something different from the Mets.

So when Asdrubal Cabrera squinted through the mist and the glare Tuesday night, his feet shuffling uneasily as if stationed on hot coals, thousands of mental Rolodexes flipped to the card occupied by Luis Castillo. He, too, had once flubbed an easy pop-up to hurt the Mets.

But Cabrera’s gaffe did not come in the ninth inning of a Subway Series in the Bronx, as Castillo’s did all those years ago. Thus, the Mets preserved a chance for redemption, which came in the 12th inning when Jay Bruce ripped a run-scoring single in a 5-4 victory over the Brewers.

“It feels really good now,” said Cabrera, bailed out after a mistake in the seventh inning opened the door for a disaster the Mets could not afford. “I’m laughing now because we got the win.”

Pinch hitter T.J. Rivera began the winning rally with a single. Michael Conforto followed with a walk. Jose Reyes, his average down to .198, failed on two bunt attempts before rolling a grounder to first that moved Rivera to third.

With the winning run 90 feet away, Bruce stung a liner to center before he was mobbed by his teammates just short of second base.

“We don’t get worked up about too much,” Bruce said, after giving the Mets their second walk-off win of the season. “We let everybody else do that.”

Somehow, the Mets (23-27) recovered from the chaos that flowed after Cabrera dropped Jett Bandy’s bases-loaded pop-up in the seventh. It should have been the third out, preserving a two-run lead for the Mets. Instead, Cabrera did not retreat enough. The ball fell in behind him. Two runners scored to tie the game.

Cabrera has played much of last season on one leg. This year, he has been among the walking wounded once more. It bought little goodwill from fans, who let out a torrent of boos, frustrated by the potential of another meltdown.

The red-hot Lucas Duda hit a two-run homer in the sixth to give the Mets a 4-1 lead.

It came after a strong effort by fill-in starter Tyler Pill, who sidestepped trouble to surrender one run in 5 1⁄3 innings. In his first big-league start, the righty scattered six hits and walked three but struck out four — good enough to walk a tightrope without falling.

But in the seventh, reliever Fernando Salas was chased after leaving the bases loaded with one out. In his league-leading 28th appearance of the season, lefty Jerry Blevins was tasked with cleaning up the mess. He almost succeeded.

After striking out Travis Shaw, he walked Domingo Santana to force in a run, but got Bandy to sky one to short. This was the beginning of a long road to redemption.

Lefty Josh Smoker tossed three shutout innings of relief before Bruce came through in the 12th. For the Mets, it was their fourth win in their last five games, and it came by overcoming the kind of late-game meltdown that has sabotaged the season.

“There’s been a lot of nights where we think we have it wrapped up and all of a sudden we can’t stop somebody,” Collins said. “This is one we needed to have.”

That relief manifested itself in a temporary lapse in judgment. In the clubhouse after the game, when asked why he missed the pop-up, Cabrera did not invoke the fog or the glare. He let slip an appropriate expletive, seemingly oblivious to the lens of a television camera before him.

The laughter had barely died down when Bruce emerged from the showers. Cabrera interrupted a thought to express his gratitude for a feeling of relief that Castillo was denied on a Bronx night in 2009.

“Thank you J.B.!” he said, calling over to his teammate. “They did it for me.”