The NL Central leaders scored three times in the eighth inning to avoid their first sweep at home this season and their first against the Cubs since September 2010.
Cubs left-hander Jon Lester left after seven dominant innings. He didn't allow a hit after the third batter and retired 20 of his final 21 hitters.
Carpenter scored after a triple in the first, and his single in the eighth ignited the rally. Piscotty's double off the center-field wall scored Peter Bourjos and Carpenter.
Cardinals right-hander Carlos Martinez needed 99 pitches to get through five innings. The Cubs stranded at least one baserunner in each of his innings, but Martinez was able to limit the damage with eight strikeouts.
Chris Coghlan took advantage of Randal Grichuk's compromised throwing arm to score the Cubs' first run on Anthony Rizzo's double. Grichuk, starting for the first time since straining his elbow Aug. 16, had to flip the ball to right-fielder Jason Heyward, who threw it in allowing Coghlan to score from first.
Rizzo appeared to be caught in a rundown following his double, but Martinez failed to cover third, allowing Rizzo to take an extra base. Tommy La Stella followed with a two-out double to give the Cubs an extra run.
Lester's second career single, both against the Cardinals, sparked Chicago's second-inning rally. The Cardinals have given up hits to opposing pitchers in four consecutive games and each have led to runs.
Coghlan made a tough catch on a tailing flyball off the bat of Tommy Pham in the fifth. Coghlan caught the ball in foul territory, but his momentum flipped him over the wall and into the crowd.
The Cardinals activated Matt Adams from the 60-day disabled list. Adams was hitting .243 in 144 at-bats with four home runs and 20 RBI before missing 91 games with the injury. Lefty Nick Greenwood was designated for assignment to make room.
Cardinals: Matt Belisle (right elbow inflammation) threw a simulated game, but no definite return date has been set for the right-hander. He has missed 65 games.
Cubs: RHP Jake Arrieta (18-6, 2.03 ERA) takes the mound to kick off a four-game series Thursday at Philadelphia. Arrieta has a 17-inning scoreless streak and was the NL Pitcher of the Month for August.
Cardinals: LHP Jaime Garcia (8-4, 1.89 ERA) kicks off a 10-game road trip Thursday at Cincinnati. Garcia is 5-0 with a 1.76 ERA since Aug. 1.
Link to box score: St. Louis (88-51) 4, Chicago Cubs (80-58) 3