Philip G. Pavely-USA TODAY Sports

Albert Pujols moved into a tie for fourth place all-time with his 696th homer and Nolan Arenado hit a tiebreaking three-run double in the ninth Saturday as the visiting St. Louis Cardinals downed the Pittsburgh Pirates, 7-5.

With the game tied 4-4 in the ninth against Pirates reliever Wil Crowe (5-9), Yadier Molina singled up the middle and was replaced by pinch-runner Lars Nootbaar, who went to third on Paul DeJong's single to shallow right.

Brendan Donovan grounded out, and Nootbaar was thrown out at home on Corey Dickerson's fielder's choice. Paul Goldschmidt walked, and then Arenado cleared the bases to make it 7-4.

Pujols finished 3-for-4, hitting his two-run shot in the sixth and adding an RBI single in the eighth, and Donovan homered for the Cardinals (82-58), who had lost two straight.

St. Louis starter Jack Flaherty pitched five innings, allowing three runs and six hits, with no strikeouts and four walks.

Giovanny Gallegos (3-5), the Cardinals' fourth pitcher, worked a scoreless eighth. Ryan Helsley gave up Bryan Reynolds' RBI single in the bottom of the ninth but picked up his 15th save.

Jack Suwinski, Rodolfo Castro and Oneil Cruz homered for the Pirates (51-87), who have lost seven of nine.

Pittsburgh starter JT Brubaker gave up three runs and six hits in six innings, with three strikeouts and two walks.

Castro hit his seventh homer in the first for a 1-0 Pittsburgh lead.

In the second, Ke'Bryan Hayes walked ahead of Suwinski's 15th homer, a shot to right, giving the Pirates a 3-0 lead.

St. Louis cut it to 3-1 in the fifth when Donovan launched his fourth homer of the season.

In the sixth, Tyler O'Neill led off with a double to left-center. An out later, Pujols banged his 17th homer of the year, to left, to tie it 3-3. That tied him with Alex Rodriguez for fourth all-time in major league history.

Against JoJo Romero in the seventh, Cruz led off with his 14th homer to give Pittsburgh a 4-3 lead.

In the eighth against Robert Stephenson, Nolan Gorman doubled to right with two outs and scored on Pujols' single to center for a 4-4 tie.

More must-reads:

TODAY'S BEST
Dolphins add another star playmaker on offense
Insider addresses if Patriots will trade for star 49ers WR
Former 49ers quarterback makes feelings on Brock Purdy clear
Insider shares confusing trade updates on Mets' Pete Alonso
Rams GM details plan to lure Aaron Donald out of retirement
NFC East check-in: Most, least improved position groups post-draft
Pacers ride bench to first playoff series win in 10 years
Knicks guard joins NBA royalty in closeout win against 76ers
Maple Leafs force Game 7 with 2-1 win over Bruins
Georgia makes Kirby Smart the highest-paid coach in college football
Dodgers ace to make first start in nearly two years on Monday
Cowboys QB Dak Prescott provides significant update on contract negotiations
Clippers will need to fight for their playoff lives in Game 6 without injured star
Why Steelers declining RB Najee Harris' fifth-year option does, doesn't make sense
Watch: Grandson of Red Sox legend homers at Fenway Park
Suns owner after disastrous season: 'The house is not on fire'
Knicks' Villanova trio knocks out the 76ers in Philadelphia
Chargers add another target for QB Justin Herbert
Report: If Lakers fire Darvin Ham, ESPN analyst would be candidate
Watch: William Nylander gives Leafs a 1-0 lead over Bruins