Locke (1-3), a 2006 second-round draft choice of the Braves, worked around five walks and two hits while striking out six to get his initial big-league win.
Jared Hughes pitched a scoreless ninth for his second save as the Bucs took the opener of the season-ending three-game series.
Starling Marte's solo homer in the fifth inning broke a 1-1 deadlock and Chase d'Arnaud also drove in a run for Pittsburgh.
Paul Maholm (13-11) took the hard-luck loss for the playoff-bound Braves, surrendering two runs on five hits over seven frames. He struck out eight.
Jason Heyward got the only RBI for Atlanta, which surrendered its faint hopes of winning the National League East. Instead, the divisional crown went to the Washington Nationals ,while the Braves settled for the NL's top wild-card spot.