Niese (3-2) broke a personal six-start winless streak with the performance, during which he allowed one run on five hits while walking two and striking out five.
The left-hander blanked the Bucs until the sixth, when Bobby Parnell came in to record the final two outs. Frank Francisco struck out a pair in the ninth for his 12th save as the Mets took the rubber match of a three-game set.
Pittsburgh starter Charlie Morton (2-5) yielded three runs on eight hits in a seven-inning effort.
Andrew McCutchen got the only RBI for the Pirates.
Biologists detail four new deep-sea 'killer sponges'
Pistorius testifies he didn't consciously pull trigger when he shot girlfriend