Joaquin Andujar won his major league-leading 19th game with the aid of catcher Darrell Porter's two-run sixth inning single in St. Louis.
Andujar (19-6) gave up nine hits and walked two in 7 1/3 innings before giving way to Jeff Lahti. Lahti was relieved in the ninth by Ken Dayley, who got the last three outs for his eighth save.
The loss was the Pirates' seventh in a row, 17th in their last 18 games and 22nd in 26 games. Pittsburgh has lost 12 straight road games. Don Robinson (2-8) dropped his eighth consecutive decision.
The Cardinals scored three runs in the sixth inning to break a 2-2 tie. Willie McGee reached base on an error by shortstop Sammy Khalifa, Tommy Herr singled and Jack Clark walked to load the bases. After a forceout at the plate, Terry Pendleton beat out a high chopper off the turf to score Herr. Porter hit an 0-2 fast ball to right field for a two-run single.
Pittsburgh tied the score with a two-run fourth inning. The Pirates loaded the bases on a single by Bill Madlock and walks to Jason Thompson and Steve Kemp. Denny Gonzalez grounded into a forceout that scored Madlock. Khalifa singled to center to score Thompson.