Scott Spiezio hit a solo homer in the fourth, scored three times and had two hits as, St. Louis closed the season with a five-game winning streak.
The winner was Kip Wells (7-17).
Jason Isringhausen hurled the final 1 1/3 innings to record his 18th straight save -- and his 32nd in 35 opportunities.
St. Louis reliever Troy Percival allowed just a hit with two strikeouts before he was pulled after the first inning in the first major league start of his career.
Pittsburgh's Jose Castillo had two runs, two hits and one RBI.
Four others had one RBI each, and six players had two hits each for the Pirates, who ended the season with four losses in a row.
The losing pitcher was starter Bryan Bullington (0-3) in the third start of his major-league career.