Outfielder Jason Heyward's third inning grand slam broke the game open after the Cardinals struck for two runs in the first off Pirates starter Charlie Morton. Shortstop Jhonny Peralta also added 3 RBI.
The Cardinals had already guaranteed themselves a fifth straight postseason appearance but Wednesday night's victory clinched the franchise's third consecutive division title, and means the Pirates and the Chicago Cubs will face off in the Wild Card game next week.
Pitcher Tyler Lyons (3-1) made his first start in the Cardinals rotation since Carlos Martinez went down with a right shoulder problem on Friday. The lefty went seven scoreless innings, allowing four hits while striking out 5.
St. Louis has an off day Thursday before the last series of the regular season starts Friday in Atlanta.
The win Wednesday was number 100 on the season. The Cardinals last reached that total in 2005.