Lonnie Smith hit a two-run homer for St. Louis and John Stuper allowed eight hits in 7 1/3 innings in Pittsburgh.
Smith turned a 2-0 pitch from John Candelaria (9-5) in the fifth into his seventh homer to give the Cardinals a 2-0 lead. Tom Herr had led off with a single.
Jason Thompson got one run back in the sixth when he hit a 2-2 pitch from Stuper (5-2) for his 22nd homer.
Stuper had four strikeouts and four walks before his departure in the eighth. Jim Kaat and Bruce Sutter finished up for the Cardinals, with Sutter posting his 24th save.
Candelaria struck out seven and walked three. Smith's homer was the first off Candelaria in his last 46 2/3 innings he's worked.h hitter Rufino Linares singled with the bases loaded in the eighth, driving in two runs as Atlanta ended an 11-game losing streak.
It was only the second victory in the last 17 games for the second-place Braves, who led the NL West for 106 days before their slide began.
San Diego moved ahead, 5-4, in the seventh on Sixto Lezcano's run-scoring single. Biff Pocoroba opened the eighth with a walk and Rafael Ramirez was safe when second baseman Tim Flannery booted his grounder. Terry Harper walked an