The Mets had three hits through four innings.

But they recorded six consecutive hits to start a momentum-turning fifth — single, single, home run, double, single, double — to erase a 3-0 deficit and defeat the St. Louis Cardinals 7-5 on Tuesday, evening their record at 18-18. Jeff McNeil had two hits in the inning. They scored six runs in the frame, the most the Mets have scored in any inning this season.

Jeff Curry-USA TODAY Sports

McNeil led off the fifth with a single. Tomás Nido followed with a hard shot to third that Nolan Arenado couldn’t handle. It was scored a hit, but it could have been a 5-4-3 double play and taken the inning in a different direction. Instead, Brandon Nimmo followed with a 440-foot, three-run home run to center to tie the game at three. It was Nimmo’s fifth homer of the season and came a day after he hit a tie-breaking home run in a 4-3 victory over the Cardinals.

Starling Marte doubled, Francisco Lindor singled and then Pete Alonso — who had been scuffling through a 1-for-32 slump and was benched Monday — hit a two-run double to right center that chased Miles Mikolas.

Alec Burleson‘s solo homer in the sixth off Cole Sulser cut the Mets’ lead to 6-4 and St. Louis threatened in the seventh, loading the bases with one out for Arenado. Jorge López got Arenado to pop out on the infield and fanned Paul Goldschmidt to end the inning.

Reed Garrett pitched a scoreless eighth and fanned two to lower his ERA to 0.47. Alonso, hopefully putting his struggles behind him, added a solo homer in the ninth, his ninth of the year. That gave New York a 7-4 lead.

With Edwin Díaz unavailable, Adam Ottavino got the save but not before making things interesting. He gave up a solo home run to Lars Nootbaar. A single and a walk later and Ottavino was facing Goldschmidt with the tying runs on base and one out. He fanned the slugger on an outside fastball and got Burleson to strike out to end the game.

Before the game, manager Carlos Mendoza said he had a “tough” call deciding whether to go with Harrison Bader, Tyrone Taylor or DJ Stewart in the outfield.

“I know they are not happy about it because they all want to play,” he said in the pre-game interview. “But it’s one of those, ‘Where we at? Who we’re facing?’ I decided to go with Stewart today, but they are all gonna play.”

It didn’t take long to see how one small call can make a big difference.

With nobody out and a runner on first in the first inning, Willson Contreras lined a shot over Stewart’s head in left field that bounced off his glove for a double. Stewart was making his first start in left this season and just his third in three years.

Arenado followed with a sacrifice fly, Burleson added an RBI single and the Cardinals led 3-0 after one. Perhaps, with a different left fielder, the score is 1-0. Brendan Donovan led off the first with a home run.

Bader would replace Stewart in the fifth after the Mets took the lead. A pre-game comment from Mendoza was prescient: “At the end of the day, I’m using all 26 guys on the roster.”

After surrendering three runs in the first, José Buttó settled down. He went five innings, giving up three hits and three walks while striking out three to earn his first win of the season and second of his career.

J.D. Martinez‘s bat struck Contreras’ arm for catcher’s interference in the second inning. Contreras left the game in a lot of pain and it was later revealed that he had a fractured left arm.

Stat of the Game

The last time the Mets got six consecutive hits was two years ago. It was Nido, Nimmo, Mark Canha, Lindor, Alonso and McNeil. Five of the six hitters were the same tonight.

Player of the Game

Nimmo was 1-for-4 with a three-run homer and a walk to raise his slash line to .229/.377/.412. He leads the team with 25 RBIs. He also made a diving catch in center.

On Deck

The Mets and Cardinals will get right back at it Wednesday with a 1:15 p.m. ET start. Jose Quintana (1-3, 5.20) will look to bounce back after giving up eight runs on 10 hits in his last start. He will be opposed by Sonny Gray (4-1, 0.89 ERA), who beat the Mets on April 27 with six innings of one-run ball. SNY will have the broadcast.