The Pirates recorded their fourth straight win at Miller Park when pinch-hitter Travis Snider homered in the ninth inning.
Mark Melancon pitched the bottom of the ninth for his 11th save as Pittsburgh earned their 81st win of the season and, more importantly, moved two games clear of the St Louis Cardinals in the National League Central.
The Cards lost 1-0 to the Cincinnati Reds, for whom Homer Bailey threw seven scoreless innings and top prospect Billy Hamilton scored the only run.
NL West leaders the Los Angeles Dodgers enjoyed a sixth straight win with a 7-4 defeat of Colorado.
Ricky Nolasco pitched six strong innings and Carl Crawford led a balanced offense with a two-run single among three hits.
Atlanta continued to set the pace in the NL East, maintaining their 15-game lead over Washington with a 3-1 defeat of the New York Mets.
Andrelton Simmons and Evan Gattis homered for the Braves to back up a solid effort from starter Kris Medlen.
Wilson Ramos hit a three-run homer and Corey Brown also went yard as Washington beat Philadelphia 9-6.
Elsewhere in the NL, Miami beat the Chicago Cubs 6-2 and San Diego saw off San Francisco 3-2.
In the American League, Jon Lester out-pitched Max Scherzer as East leaders Boston edged out Central table-toppers Detroit 2-1.
Scherzer went into the contest hoping to become just the second pitcher to open a season with a 20-1 record but the usually heavy-hitting Tigers failed to provide the necessary offense.
Will Middlebrooks' two-run single was all Lester needed to improve his record to 13-8.
Koji Uehara pitched the ninth for his 17th save in 20 opportunities and extended his scoreless streak to 25 innings.
The New York Yankees scored five runs in the eighth inning to down the Chicago White Sox 6-4.
Derek Jeter finished with two hits, giving him 3,315 to pass Eddie Collins (3,313) for ninth on the all-time list.
Ubaldo Jimenez's recent strong form continued as he pitched six shut-out innings and Yan Gomes and Asdrubal Cabrera drove in two runs apiece as Cleveland beat Baltimore 4-3.
In Tuesday's other games, Texas edged ahead of Oakland in the AL West with a 5-1 win over the As, Tampa Bay beat the Los Angeles Angels 7-1, Toronto thrashed Arizona 10-4 and Minnesota required 12 innings to beat Houston 9-6.