PITTSBURGH (AP) — Clint Hurdle had a decision to make with his Pittsburgh Pirates tied in the top of the 12th inning with the St. Louis Cardinals.

The Cardinals had a runner on first base, rookie shortstop Aledmys Diaz, a .317 hitter, coming to the plate and pitcher Adam Wainwright standing in the on deck circle waiting to pinch-hit for reliever Jonathan Broxton as St. Louis was out of position players.

The manager decided to intentionally walk Diaz and got burned when Wainwright followed with a two-run, two-out double to spark a six-run inning as St. Louis won 9-3 on Friday night.

"I really struggled with giving Diaz an opportunity when you figure Wainwright would be next," Hurdle said. "You make those decisions, and we weren't able to get him out, and it snowballed on us after that."

Matt Carpenter started the rally by drawing a two-out walk from Juan Nicasio then Wainwright followed the walk to Diaz with a drive to the gap in left-center. Wainwright is hitting .261 this season, going 6 for 23 with four doubles, one triple and one home run.

"Other than winning the World Series, this ranks right up there," said Wainwright, a 12-year veteran who has won two World Series rings and twice finished second in the NL Cy Young Award balloting. "The Pirates are a tough team to beat, especially in this ballpark and I'm like a kid in the candy store any time I get to hit.

"This was really special, though, because the game was on the line."

The Cardinals added four more runs in the inning. Matt Adams hit an RBI double to extend his hitting streak to 10 games and scored on Jhonny Peralta's single before Brandon Moss' two-run homer, his 14th, capped the outburst.

It ended a bad night for the Pirates as starting pitcher Gerrit Cole left in the third inning with right triceps tightness and catcher Francisco Cervelli left in the next inning with a sore left hand.

Cole said he has never experienced triceps problems before and will be examined Saturday by team doctors.

"They keep telling me that the worst time to check stuff out is right after a competition, so they told me they'll do some further recon on what's going," Cole said.

Cole was removed after giving up a leadoff single to Carpenter. He was relieved by AJ Schugel after not allowing a run in two-plus innings. Cole gave up two hits and one walk while walking three.

"I gave it everything I had," Cole said. "In the third inning, it wasn't right."

Schugel pitched four perfect innings and struck out four.

Cervelli left after swinging at the first pitch of his at-bat and the Pirates have no further update after the game. Chris Stewart pinch-hit and remained in the game at catcher.

Nicasio (5-5) was charged with six runs in one inning after beating the New York Mets in the second game of a doubleheader Tuesday when he allowed one run in five innings as a starter.

Broxton (1-0) pitched two scoreless innings as the Cardinals (33-28) won for the fifth time in six games, moved a season-high five games over .500 and snapped a second-place tie with the Pirates in the NL Central. St. Louis, though, trails the first-place Cubs by nine games.

The Pirates, who lost their third straight game, scored a run off Cardinals closer Trevor Rosenthal in the bottom of the ninth to tie the score 3-3 when Starling Marte hit a leadoff triple and scored on Jordy Mercer's one-out single.

The Cardinals went ahead 3-2 in the eighth inning on Carpenter's three-run home run, his 10th, off Neftali Feliz. They had been blanked on two hits through the first seven innings.

Marte had two hits for the Pirates, who scored their first two runs on Josh Harrison's force out grounder in the third inning and John Jaso's single in the fifth.

Carpenter had two hits to run his hitting streak to seven games. Peralta and Moss also had two hits.

St. Louis' Michael Wacha pitched well, allowing two runs in seven innings, but remained winless in nine starts since April 23 when Rosenthal blew the save.

TRAINER'S ROOM

Cardinals: Carpenter (jammed finger on right hand) returned after leaving a 3-2 win at Cincinnati on Thursday night in the eighth inning . RHP Lance Lynn, who underwent Tommy John elbow ligament transplant surgery in November, is expected to be examined by the team's medical staff later this month in St. Louis and also throw in front of the coaching staff.

UP NEXT

Cardinals: RHP Carlos Martinez (6-5, 3.76 ERA) will start Saturday night in the second game of the three-game series. Martinez has won consecutive starts after losing his previous five.

Pirates: LHP Francisco Liriano (4-5, 5.25) is 7-2 with a 2.41 ERA against the Cardinals in 14 career starts.