Jeff Curry-USA TODAY Sports

Pete Alonso hit a two-run homer as the visiting New York Mets edged the St. Louis Cardinals 4-2 Thursday.

Tim Locastro also hit a home run for the Mets, who earned their fourth victory in their last five games.

Mets starting pitcher Jose Quintana (1-4) allowed two runs on three hits and four walks in six innings. Trevor Gott earned his first save since 2020.

Cardinals starting pitcher Adam Wainwright (3-8) allowed three runs on four hits and three walks in six-plus innings. He struck out five.

Tyler O'Neill hit a homer for the Cardinals, who suffered just their third loss in eight games.

In his previous two starts Wainwright retired just 12 batters while allowing 15 runs on 18 hits. This time he allowed just one hit in his first three innings before the Mets surged ahead 2-0 in the fourth inning.

Jeff McNeil hit a one-out double that was nearly a homer. Right fielder Jordan Walker leaped at the fence to pull the ball back, but he couldn't complete the catch.

Alonso followed with his 37th homer of the season, a no-doubter well over the center field wall.

Quintana retired the first 10 batters he faced, with the help of Brandon Nimmo's diving catch in left field in the third inning that robbed Jose Fermin of a double.

Paul Goldschmidt hit a one-out single for the Cardinals in the fourth inning and Willson Contreras and O'Neill drew a two-out walks to load the bases. But Walker hit into an inning-ending fielder's choice.

The Mets pushed their lead to 3-0 in the fifth inning when Rafael Ortega and Nimmo drew walks and Francisco Lindor hit an RBI double.

The Cardinals cut their deficit to 3-2 in the seventh inning. O'Neill led off with a homer, the first Quintana allowed this season.

Walker walked and Andrew Knizner hit a single to chase Quintana. Pinch-hitter Alec Burleson greeted reliever Drew Smith with a sacrifice fly, then Fermin walked and Tommy Edman advanced the runners with a groundout.

But Goldschmidt grounded out to leave two runners in scoring position

Locastro hit his homer in the ninth inning to expand the Mets' lead to 4-2.

The Cardinals put runners on first and second base with two outs in the ninth, but reliever Trevor Gott struck out Goldschmidt to end the game to notch his first save this season.

More must-reads:

TODAY'S BEST
WNBA experienced viewership and attendance surge in May
MLB players name the ‘most overrated player’ in the league
White Sox catcher undergoes season-ending surgery
Report: Lakers HC job viewed negatively within NBA
One player makes bizarre choice for 'most overrated' colleague
Patriots legend addresses if Drake Maye should sit as a rookie
Steelers extend HC Mike Tomlin
Former Lakers HC lands intriguing, familiar gig
Dan Hurley has made a decision on coaching future
Scottie Scheffler broke one of his own records Sunday at the Memorial
Rick Pitino shares whether he thinks Dan Hurley will leave UConn
Former Pro Bowl returner earns tryout with Jets
Aaron Judge upset with Yankees fans during series finale against Dodgers
Watch: Kyrie Irving has message for Celtics fans after Game 2 loss
Jordan Love believes Packers 'don't have to have a No. 1 receiver'
Umpiring blunder mars classic French Open final
Celtics stars don't have to be at their best for team to win NBA title
Luka Doncic needs more help than supporting cast can give him against deep Celtics
Watch: Carlos Alcaraz makes history with first French Open title
Kyle Larson wins strategical dogfight at chaotic Sonoma