Charles LeClaire-USA TODAY Sports

The Pittsburgh Pirates scored four runs in the fourth inning Wednesday as they overcame an early three-run deficit to down the visiting St. Louis Cardinals 5-3 in the teams' regular-season finale.

Rodolfo Castro, Diego Castillo and Kevin Newman each had an RBI hit for the Pirates (62-100).

Pittsburgh starter Johan Oviedo gave up three runs (two earned) and five hits in four innings, with one strikeout and no walks.

Manny Banuelos (2-1) pitched 1 2/3 scoreless innings. Yohan Ramirez pitched the ninth for his first save.

Tommy Edman and Nolan Arenado each hit an RBI single for the Cardinals (93-69), who host the Philadelphia Phillies in a wild card series starting Friday.

St. Louis starter Matthew Liberatore (2-2), just recalled from Triple-A Memphis, allowed five runs and six hits in five innings, with three strikeouts and four walks.

In the first, Lars Nootbaar doubled to center and scored on Edman's single to left for a 1-0 Cardinals lead. Edman stole second and, an out later, scored as Corey Dickerson reached on Castillo's fielding error at first.

St. Louis upped its lead to 3-0 in the third. Edman doubled to left with one out and scored when Arenado -- who did not play in the first two games of the series because of a quadriceps issue -- singled to right.

In the bottom of the third, Ji Hwan Bae got hit by a pitch, went to second on Newman's groundout and scored on Castro's base hit to left to cut it to 3-1.

Pittsburgh sent eight to the plate in the fourth and took a 5-3 lead. Miguel Andujar tripled to left-center and scored on a wild pitch. Oneil Cruz walked and scored on Castillo's double to left-center for a 3-3 tie.

After Jack Suwinski walked, he and Castillo advanced on Jason Delay's sacrifice bunt. Castillo came home on Bae's groundout for the tiebreaking run. Newman drove in Suwinski with a single to left.

St. Louis catcher Yadier Molina, who is retiring after an illustrious career, pinch hit in the seventh and, in his final regular-season at-bat, lined out to second.

The Cardinals' other retiring future Hall of Famer, Albert Pujols, did not appear in the game.

More must-reads:

TODAY'S BEST
Steelers back makes revealing comment about difference in QB situation
Predicting which non-2023 playoff teams will make the postseason in 2024
Rejuvenated Stars head into Game 4 after OT win
Watch: Yankees slugger Aaron Judge homers for second straight game vs. Brewers
Christian McCaffrey encouraged Commanders GM to draft brother Luke
Watch: Knicks' Jalen Brunson receives MVP chants in road playoff game vs. 76ers
Insider believes Drake Maye has chance to start right away for Patriots
Frank Gore reacts to son signing with Bills
Pair of Bucks stars to miss Game 4 vs. Pacers
Sam Hartman's contract proves the Commanders see something in him
Jayson Tatum names team's 'most important guy'
10 notable steals from the 2024 NFL Draft
Mind-blowing stat sums up Nuggets-Lakers series
Chargers WR Ladd McConkey ready to show Justin Herbert what he can do
Lakers end 11-game skid vs. Nuggets, force Game 5
Jerry Rice's son drafted by AFC West team in seventh round
Braves two-time All-Star addresses future with team
Bucks' playoff hopes take another blow with devastating Damian Lillard update
Nationals two-time All-Star lands on IL amid struggles
'Freakin dream come true': Jets draft FSU's record-breaking QB