PITTSBURGH (AP) — Matt Carpenter seemed to send the St. Louis Cardinals on their way to an easy win over the Pittsburgh Pirates on Friday night. His three-run homer gave St. Louis a 5-1 lead in the second inning.

When Luke Voit replaced Carpenter at first base in the seventh inning, the Cardinals led 10-3. It reached 11-3 in the eighth before they nearly let it slip away.

St. Louis eventually won 11-10 but despite the near collapse, Carpenter said he was never nervous in the dugout.

"Never a doubt. Never a doubt," said Carpenter, who hit the second of three St. Louis home runs in the first three innings. "It was interesting, for sure, but I knew we'd find a way to finish it off."

The Cardinals have taken the first two games of a four-game series against the Pirates to remain 1 1/2 games behind the National League Central-leading Chicago Cubs.

St. Louis has won 10 of their past 13 games despite losing three straight from Aug. 13-16. It has scored at least eight runs in eight of those 10 wins.

"We needed all of them, 11 (runs)," Cardinals manager Mike Matheny said. "I just can't say enough when an offense puts days like that together."

Right-hander Carlos Martinez (10-9) allowed three runs and six hits with four strikeouts for the win. Right-hander Seung Hwan Oh picked up his 19th save.

The Cardinals survived a late Pirates push.

Max Moroff hit a two-run home run, Pittsburgh's third of the game, 420 feet into the Allegheny River on a bounce beyond the right field wall to make it 11-5 in the eighth. Josh Bell hit an RBI double and Elias Diaz drove in two runs with a double to cut the deficit to 11-8 later in the inning.

Pittsburgh scored two more in the ninth, but left the bases loaded.

"They played. They continued to play," Pirates manager Clint Hurdle said. "They continued to fight. They worked well in the dugout together. They continued to talk baseball."

The Pirates' losing streak reached six games. They are 6 1/2 games behind the Cubs.

Tommy Pham homered in the first inning to give the Cardinals a 1-0 lead and Paul DeJong made it 6-2 with a solo shot in the third. St. Louis scored two runs in the fourth inning to take an 8-2 lead and chase Pirates starter Trevor Williams.

Williams (5-6) lasted three innings while allowing eight runs, three home runs and seven hits with three strikeouts.

"I thought the command was there," Williams said. "I had all four pitches working in the zone. It's just unfortunate the low ball was taken away from me early. But then again, I still have to make pitches."

Starling Marte hit an RBI triple to cut the Cardinals' lead to 8-3 in the fifth inning.

DeJong, who was 3 for 5 with two RBIs, drove in Martinez with a single and Dexter Fowler followed with an RBI double to push the lead out to 10-3 in the top of the sixth and Jose Martinez extended it to 11-3 with a single in the eighth.

Josh Harrison tied it 1-1 in the first inning with his second home run in the past two days. His 14 home runs are a career high, topping his 13 from 2014. David Freese led off the bottom of the second with a home run to cut Pittsburgh's deficit to 5-2.

TRAINER'S ROOM

Cardinals: RHP Adam Wainwright was placed on the 10-day disabled list on Friday with right elbow impingement. He went just three innings while allowing five runs and seven hits in his start against the Pirates on Thursday night. RHP Mike Mayers was recalled from Triple-A Memphis to fill the roster spot.

Pirates: LHP Wade LeBlanc went on the 10-day disabled list with a left quad strain. He allowed four runs in the ninth inning to the Cardinals on Thursday. LHP Steven Brault, who allowed two runs and four hits in four innings in relief of Williams, was recalled from Triple-A Indianapolis.

UP NEXT

Neither team announced a starting pitcher for Saturday.

___

More AP baseball: https://apnews.com/tag/MLBbaseball