Bell's 17th homer came against Seung-Hwan Oh (1-5) with one out and also drove in Adam Frazier, who led off the ninth with a double, and Andrew McCutchen.
Pittsburgh (43-47), fourth in the National League Central, won for the sixth time in seven games and moved within a half-game of the second-place Cardinals (43-46).
Felipe Rivero (4-2) pitched a perfect ninth for the win.
Neither starter got a decision after they left with the scored tied at 2.
St. Louis sinker-baller Mike Leake gave up two runs and seven hits in five innings with five walks and three strikeouts. It was a decent rebound from his previous start when he gave up a season-high eight runs.
Pittsburgh's Gerrit Cole got his pitch count up to 102 in six innings. He allowed four hits, one of them Jedd Gyorko's two-run homer in the first. Cole, who struck out four and walked none, then retired nine batters in a row and 16 of the 18 he faced after the homer.
It was Cole's fifth quality start in his past five starts.
Cole needed 28 pitches to get out of the first inning, and one of those was a full-count, two-out slider that Gyorko belted 408 feet to center with a man on for a 2-0 St. Louis lead.
Pittsburgh climbed within 2-1 in the third. Cole led off with an infield single and, two outs later, scored on Bell's single to left.
In the fourth, Gregory Polanco led off with a double off the wall in center and moved to third on Francisco Cervelli's groundout. After Jordy Mercer walked, Cole had a chance to contribute offensively again.
Instead, Polanco got picked off third, and Cole then got booed when he slowly jogged to first on a grounder when he might have been safe thanks to a high throw from Gyroko at third.
The Pirates tied it in the fifth. Leake walked the bases loaded with two outs and Polanco drove in McCutchen with a single to right.
NOTES: Pittsburgh manager Clint Hurdle got ejected in the sixth inning by home plate umpire Jerry Layne when he argued against a timeout call that prevented a runner from advancing. ... St. Louis RF Stephen Piscotty left in the ninth inning after running to catch a shallow fly ball and grabbing at his right thigh. ... St. Louis OF Randal Grichuk (back strain) was placed on the 10-day DL. ... Cardinals OF Jose Martinez was recalled from Triple-A Memphis. ... 3B Jung Ho Kang is unlikely to join the Pirates this season, GM Neal Huntington told the Pittsburgh Post-Gazette. Kang does not have a work visa to leave his native South Korea after multiple DUIs. ... Pittsburgh altered its rotation from what was originally announced. RHP Jameson Taillon, a late scratch because of food poisoning, is starting Saturday instead of RHP Chad Kuhl. ... In an unusual game-day move, the Cardinals chartered to Pittsburgh on Friday morning. ... The cable rights-holder that carries Pirates games changed its name to AT&T Sportsnet.