Mark Melancon (2-4) struck out Matt Adams and Jhonny Peralta to start the bottom of the ninth. Yadier Molina worked a walk and Jon Jay singled before Bourjos' grounder up the middle brought home the game-winning run.
Trevor Rosenthal (2-6) pitched a scoreless top of the ninth to earn the win. Starter Shelby Miller tossed seven strong innings, allowing just three hits and three walks with five strikeouts.
Jay and Bourjos both had two hits for the Cardinals, who won their fifth straight game.
Edinson Volquez didn't factor into the decision, but was solid. The right- hander, who held the Cardinals without a hit through the first four frames, gave up three hits and two walks while fanning five batters.
Neil Walker finished 3-for-3 with a double for Pittsburgh, which lost its fourth stright game.
Volquez plunked both Matt Holliday and Adams with one out in the fourth. He recovered to strike out Peralta on three pitches and induce an inning-ending groundout from Molina.
Jay's base hit up the middle to start the fifth broke up Volquez's no-hitter. Bourjos followed with a single to right and Miller moved both runners up a base with a sacrifice bunt. Volquez struck out Matt Carpenter and Kolten Wong to keep it a scoreless game.
Walker led off the seventh with a double to the right-field corner and moved to third after Russell Martin flied out. Ike Davis was intentionally walked, Starling Marte hit a broken-bat liner to second and Jordy Mercer lined out to leave the runners stranded.
Rosenthal came on to pitch the ninth for St. Louis and gave up a leadoff single to Walker, but got Martin to hit into a double-play. Travis Snider popped up to third for the final out.