Paul Halfacre-USA TODAY Sports

Andrew McCutchen hit a two-run homer in the 10th inning as the visiting Pittsburgh Pirates defeated the St. Louis Cardinals 6-3 Saturday.

Rodolfo Castro went 3-for-5 with two RBIs for the Pirates, who have won eight of their last 12 games. Ke'Bryan Hayes and Connor Joe each went 2-for-4 with two runs and an RBI.

Pirates starter Roansy Contreras allowed two runs on six hits in six innings. He struck out six and walked three.

David Bednar (2-0), the fifth Pittsburgh pitcher, earned the victory and Dauri Moreta earned his first save.

Cardinals starter Steven Matz allowed two runs on three hits and five walks in 5 2/3 innings.

Jordan Hicks (0-1), the fourth Cardinals pitcher, allowed three runs (two earned) to take the loss.

Cardinals manager Oliver Marmol was ejected in the third inning for disputing ball-and-strike calls with home plate umpire Will Little.

Hayes led off the game with a 440-foot homer, his first of the season.

The Cardinals countered with two runs in the bottom of the first. Brendan Donovan and Alec Burleson hit doubles to produce one run, then Paul Goldschmidt hit an infield single and Nolan Gorman followed with a sacrifice fly.

The Pirates tied the game 2-2 in the third. Hayes drew a one-out walk and Bryan Reynolds hit a single, then Carlos Santana and Joe drew two-out walks to force in a run.

Pirates reliever Rob Zastryzny walked leadoff hitter Lars Nootbaar in the seventh and allowed Tommy Edman's single. After Andrew Knizner bunted them over, Zastryzny walked Donovan to load the bases.

Robert Stephenson relieved Zastryzny and walked Goldschmidt to give the Cardinals a 3-2 lead.

The Pirates tied the game 3-3 in the eighth. Joe hit a two-out single, then Ryan Helsley relieved Stratton and allowed Castro's RBI double.

After McCutchen's two-run homer in the 10th, Joe hit a one-out triple and scored on Castro's single to put the Pirates up 6-3.

More must-reads:

TODAY'S BEST
Mavericks advance to Western Conference Finals aided by controversial call late
Connor McDavid, Oilers hammer Canucks to force Game 7
Tyson Fury-Oleksandr Usyk epic increases excitement for potential rematch
Seize the Grey wins in muddy Preakness
Even Mike Budenholzer admits the Suns need a point guard
Watch: Juan Soto's first multi-homer game as a Yankee
Xander Schauffele, Collin Morikawa lead at PGA Championship
Knicks could get major boost for Game 7 showdown with Pacers
Giants All-Star pitcher suffers setback in recovery from injury
Panthers star named winner of 2024 Selke Trophy
WNBA to investigate $100,000 sponsorship deals for Aces players
Tiger Woods blames one big factor for missing the cut at PGA Championship
'Ain't good enough': Draymond Green claims Celtics must 'win it all' or it's a 'failure'
Blue Jays GM wants struggling club to feel 'massive sense of urgency'
Raptors expected to flip former NBA champion during the offseason
MLB insider reveals Mets' massive extension offer that Pete Alonso turned down
Celtics legend provides update after gruesome finger injury
Bulls hire former NBA head coach as top assistant
Chiefs move on from young running back
20-year MLB veteran working out, unsure about playing future