Andrew McCutchen hit a three-run blast during Pittsburgh's four-run eighth, but Sean Marshall came on to record the final out of that inning and Aroldis Chapman turned in a perfect ninth for his sixth save.
Johnny Cueto (6-3) earned the win, giving up three runs on six hits.
Brad Lincoln (3-1) gave up five runs on six hits over four innings to suffer the loss.
Benedict Cumberbatch's dramatic reading of R. Kelly lyrics is just what you need
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'