With the Cardinals leading 2-1 and two outs in the second inning, Carpenter homered over the center field wall to extend the lead to 5-1. It was the second of three St. Louis home runs in the first three innings.
The Cardinals, whose lead reached 11-3 in the eighth inning, 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.
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.