NEW YORK — With a beleaguered bullpen having so much trouble closing games for the New York Mets lately, second baseman Jeff McNeil took it upon himself to save this one.

McNeil made a perfect throw from right field to home plate for the final out, and the Mets held off the St. Louis Cardinals 8-7 on Saturday night after starter Noah Syndergaard exited with a strained right hamstring.

"That was just a whirlwind of emotions," rookie slugger Pete Alonso said.

Alonso smashed a mammoth three-run homer off the facing of the third deck in a five-run first inning against Michael Wacha (4-3). J.D. Davis homered and had four hits, finishing a triple short of the cycle. And this time, New York's relievers finally held on — barely — after blowing late leads in the first two games of the series.

"Third time's a charm and there was never a doubt," manager Mickey Callaway said, chuckling. "A win's a win and it was a great play by Jeff. Heads-up play to get it in and get it home. Great throw."

Seth Lugo struck out three in the eighth, fanning Matt Carpenter with the bases loaded to end the inning. Scuffling closer Edwin Díaz gave up a two-out RBI single to Yadier Molina in the ninth, and Kolten Wong lofted a pop fly toward the right field line.

McNeil sprinted a long way in pursuit and converged with outfielder Michael Conforto, yet neither could make the catch. Conforto tumbled to the turf, but McNeil stayed on his feet and quickly grabbed the ball as it trickled away. He zipped a one-hop throw right to catcher Wilson Ramos that easily nailed Jack Flaherty, the Cardinals pitcher who was pinch-running for the slow-footed Molina.

"Mike goes in there sliding, I go in there leaping. I think once the ball hit the ground, I knew they were going to send him," McNeil said. "Pick it up and I kind of got lucky; I was behind the ball, so I got some oomph on the throw."

Flaherty looked back at the ball while running and stumbled coming around third.

"You see Flaherty chugging the bases and I thought he was going to score," Wacha said. "The guy made a heck of a throw from right field — right on the money. So I mean, you've just got to tip your cap at some point and go get 'em tomorrow. But it was a crazy ending, that's for sure."

A fired-up McNeil pumped his right arm and the Mets celebrated after a narrow escape. Díaz got his 15th save in 18 attempts.

"It was pretty nerve-wracking," Davis said.

Added Callaway: "It's not easy for us right now. But tonight is a step in the right direction, no matter how it happened. We held the lead and hopefully we can build off of that."

Dexter Fowler homered early and had three RBIs for the Cardinals, who stole six bases — their most in 20 years. Mets nemesis Paul DeJong added three hits and a sacrifice fly.

Syndergaard (5-4) reached for his right hamstring after throwing a pitch in the seventh. Callaway and an athletic trainer came out to check on the right-hander, who walked off the field with a bit of a limp.

"It was on that one pitch," Callaway said, adding Syndergaard will be re-evaluated Sunday morning. "That deep in the game, if he feels anything, you get him out with a five-run lead."

Robert Gsellman entered with the Mets leading 8-3. St. Louis scored three times before the inning ended on a line-drive double play.

Syndergaard threw 102 pitches and was unavailable for comment after the game. He was charged with five runs, four earned, and six hits in six-plus innings.

New York has won 14 of 19 at Citi Field.

POWER BALL

New York has homered in 19 straight home games, extending a team record, and 13 in a row overall — the club's longest streak since going 13 consecutive games over two seasons from October 2012 to April 2013.

Alonso said about a week ago, chief operating officer Jeff Wilpon was needling him before batting practice about reaching the third deck of the left field stands with a home run.

"He's like, 'Yeah, I saw Yoenis Cespedes go up there. I've seen Albert Pujols go up there. But I haven't seen you go up there,'" Alonso said. "There it is, Jeff."

TRAINER'S ROOM

Cardinals: Paul Goldschmidt was rested before drawing a pinch-hit walk in the eighth. He remained in the game at first base. ... Molina was shaken up after getting hit on his glove hand by a foul ball in the sixth.

Mets: 2B Robinson Canó (left quadriceps) rejoined the team and is eligible to come off the injured list Sunday. He went 4 for 10 with three doubles in three rehab games at Triple-A Syracuse. ... LHP Justin Wilson struck out two in a scoreless inning during a rehab appearance at Class A Brooklyn after making two with Syracuse. He has been sidelined since May 7 with a sore left elbow. ... OF Brandon Nimmo (neck) was returning to New York to be examined and treated after he was scratched from a scheduled rehab appearance with Syracuse with neck stiffness Friday night. ... Gsellman returned to the mound after saying he had a stiff back following his scoreless inning Friday night.

OUCH!

Plate umpire Brian O'Nora left in the third inning, a few pitches after getting hit in the groin by a foul ball. First base ump Chad Whitson moved behind the plate, and the game resumed with a three-man crew.

UP NEXT

Cardinals RHP Dakota Hudson (5-3, 3.47 ERA) starts the series finale Sunday against LHP Jason Vargas (3-3, 3.68).