Hamels gave up a solo home run to Starling Marte in the second and a three-run home run to Jung Ho Kang in a five-run fifth inning. Andrew McCutchen and Gregory Polanco also homered for the Pirates.
Niese allowed one run on seven hits, two walks and a strikeout over six innings. He is now 2-0 with a 1.89 ERA in his last three starts.