Wong had been out since July 22 with left knee inflammation and brought a .216 batting average into the game.

“I thought I’d be a little rusty, but I felt pretty good,” Wong said. “You want to come back and help the team get a win so it’s a good feeling. It was a really good win for us as a team, just not me individually.”

Gyorko hit a pair of doubles, including a tiebreaking one in the fifth inning.

Matt Carpenter doubled and tied a career high with his NL-leading 28th home run, a solo shot in the ninth off Dovydas Neverauskas. Jose Martinez doubled twice, and Harrison Bader also had two of the Cardinals’ 14 hits.

“Relentless is the word that comes to mind,” St. Louis interim manager Mike Shildt said. “Our guys were relentless and had a lot of quality at-bats.”

Dakota Hudson (2-0) pitched three perfect innings in relief of fellow rookie Austin Gomber, who gave up four runs in four innings.

“They had the momentum then we had the momentum then they had the momentum and Dakota swung the momentum back to our side,” Shildt said. “He pitched three lights-out innings.”

“I’m just trying to simplify things,” said Hudson, who has not allowed a run in his first four major league games and six innings. “Just come in and get people out then hand the ball off to the next guy.”

Ivan Nova was also touched for four runs in four innings. The Pirates had won his previous four starts.

“They had a lot of good at-bats, (Molina) especially, threw a lot of pitches to him and everything I had, he fouled it off,” Nova said.

Pittsburgh’s David Freese homered to open the scoring in the second inning. The Pirates lost for just the second time in their last 12 games inside the NL Central.

St. Louis moved ahead for good by scoring twice off Alex McRae (0-1) in the fifth inning to break a 4-4 tie. Jose Martinez and Gyorko led off with back-to-back doubles and Gyorko scored on Bader’s groundout.

McRae allowed three runs in 3 1/3 innings.

The Cardinals moved ahead 3-1 with three runs in the third as Martinez hit an RBI double and Gyorko followed with a two-run double. Bader doubled and scored on Gomber’s grounder in the fourth to make it 4-1.

The Pirates tied it with three in the fourth. Jordy Mercer singled in a run and Adam Frazier hit a two-run double.

TRAINER’S ROOM

Cardinals: RF Tyler O’Neill (groin discomfort) was scratched just before game time and replaced by Martinez. . OF Dexter Fowler (broken left foot) was placed on the 10-day disabled list. He was examined by team doctors in St. Louis on Saturday and will wear a walking boot for one month then be reevaluated. Fowler was removed in the eighth inning of Friday night’s 7-6 loss to the Pirates after fouling a ball off the foot.

Pirates: OF Corey Dickerson was activated from the 10-day DL and flied out as a pinch-hitter. INF/OF Christopher Bostick was optioned to Triple-A Indianapolis. . With 1B Josh Bell (strained left oblique) on the DL, C Francisco Cervelli made his first start at first base since 2016 and went 2-for-3 with a walk while handling 10 total chances flawlessly.

VAN SLYKE FETED

Retired five-time Gold Glove-winning outfielder Andy Van Slyke threw out the ceremonial first pitch on his bobblehead night. Van Slyke played for both the Cardinals (1983-86) and Pirates (1987-94).

UP NEXT

Cardinals: RHP Jack Flaherty (4-6, 3.49 ERA) starts Sunday and the rookie is 1-4 with a 4.03 ERA in his last nine starts. St. Louis will try to win three series in a row for the first time this season.

Pirates: RHP Trevor Williams (9-7, 3.89 ERA) has pitched a combined 17 scoreless innings while winning his last three starts.