After homering in a 7-2 loss earlier in the day in Game 1 of a doubleheader against the Chicago Cubs, Carpenter came off the bench in Game 2 and launched a pinch-hit solo homer in the seventh inning off reliever Randy Rosario.
He drew a walk in the ninth inning, when the Cardinals scored three runs and won 6-3 to split the doubleheader.
Carpenter's home run streak surpassed that of Mark McGwire, who homered in five straight games for the Cardinals during the 2001 season.
The record home run came one day after the red-hot Carpenter hit three home runs with seven RBIs as part of a 5-for-5 day in an 18-5 win over the Cubs.
"It's really hard to put into words what is happening and what I feel like," Carpenter said. "I've felt like this before in the sense that I feel like I'm comfortable at the plate. I feel like I'm swinging at good pitches and my swing feels like it's where it needs to be. But obviously, I've never had a stretch like this. It's hard to put into words. I don't know why. Maybe it's the salsa."
Carpenter now has 25 home runs this season, including 10 this month, making him the first Cardinals player with 10 homers in July since Jim Edmonds hit 13 in July 2004, according to ESPN Stats & Info. Carpenter's last 12 hits have been extra-base hits.
Carpenter has eight total homers during his streak. The last player with as many home runs during a six-game homer streak was Barry Bonds, who also had eight during his streak in 2004.
"You talk about the definition of locked in; that's what it looks like,'' Cardinals manager Mike Shildt said.
Carpenter said he is starting to get requests from his teammates for his salsa.
"Oh, yeah, now it's becoming a thing,'' he said. "Everybody's like, 'What did you put in that stuff?'"
The Associated Press contributed to this report.