ST. LOUIS (AP) — Paul Goldschmidt homered, Richie Palacios hit a two-run single and the St. Louis Cardinals beat the New York Mets 7-3 on Sunday to avert a four-game series sweep.

Goldschmidt finished with three hits and three RBIs as St. Louis stopped a four-game slide. Tommy Edman, Alec Burleson and rookie Masyn Winn each had two hits.

Cardinals right-hander Dakota Hudson (5-0) struck out seven in 5 1/3 innings. He allowed two runs and and five hits.

Pete Alonso connected for New York, which had won four in a row. Alonso has 39 homers and has gone deep in four of his last five games.

Goldschmidt drilled a two-run homer off Carlos Carrasco in fifth inning, lifting the Cardinals to a 3-2 lead. It was Goldschmidt’s 20th homer.

St. Louis added four more runs in the seventh. Willson Contreras singled in Goldschmidt, and Jordan Walker doubled home Nolan Arenado. Palacios capped the big inning with his two-run single.

Palacios also made a big defensive play to end the second, reaching over the fence in center to take a home run away from DJ Stewart.

Carrasco (3-7) was charged with three runs and nine hits in four innings.

MOVING ON UP

The Mets recalled right-hander Reed Garrett from Triple-A Syracuse. Right-hander Vinny Nittoli was sent down.

The 30-year-old Garrett pitched 1 2/3 scoreless innings in the loss.

SUNDAY SPECIAL

The Cardinals improved to 13-7 on Sundays this season. It is their only winning day of the week.

TRAINER’S ROOM

Cardinals: LHP Matthew Liberatore is bothered by a sore back and had his scheduled Monday start moved to Wednesday.

UP NEXT

Mets: LHP David Peterson (3-7, 5.45 ERA) will start in the first game of a three-game series in Atlanta on Monday.

Cardinals: LHP Drew Rom will start the first game of a three-game series on Monday in Pittsburgh. Rom, who was acquired from Baltimore at the trade deadline as part of the Jack Flaherty deal, will be making his major debut. The Pirates have yet to name a starter.