Francisco Cervelli hit a leadoff double in the 14th and Starling Marte followed with a chopper. First baseman Daniel Murphy grabbed the grounder, but made a late throw to third trying to get Cervelli. Stewart and Sean Rodriguez followed with RBI singles.
Six relievers combined for 7 2-3 scoreless innings for Pittsburgh.
Sean Gilmartin (1-1) took the loss.
Mets center fielder Yoenis Cespedes unleashed one of the best throws this season, nailing Rodriguez when he tried for a triple with one out in the ninth.
Cespedes corralled the ball on the edge of the warning track in left center field and, as he started to fall backward, let loose with a perfect, one-hop peg.
Aramis Ramirez hit a two-run homer in the Pittsburgh first, his 12th of the season and first since returning to the team where he began his 18-year career.
Gregory Polanco homered off the right field foul pole against Jonathon Niese for a 3-0 lead in the third.
Pirates: Marte (bruised left hand) was held out of the starting lineup for the third straight night. He entered in the sixth as a pinch-runner and remained in left field. He was hitless in three at-bats and scored a run . Josh Harrison (broken left thumb) and Jordy Mercer (left knee MCL sprain) continued their rehab assignments Saturday at Triple-A Indianapolis.
Mets: David Wright (spinal stenosis) played in his fourth rehab game for Class A St. Lucie, going 0 for 3 with a walk while playing seven innings at third base ... LHP Steven Matz (lat strain) was the starter in that game at Jupiter, allowing a run on three hits over one inning, striking out two. ... 1B Lucas Duda (lumbar strain) hadn't played in four games, but drew a walk as a pinch-hitter in the 12th. He plans to re-enter the starting lineup on Tuesday in Baltimore.
Pirates: Jeff Locke (6-7, 4.43) starts the series finale on Sunday. The left-hander has given up 15 runs in his last four outings, walking 10.
Mets: Matt Harvey (11-7, 2.61) is 3-1 with a 1.23 ERA over five starts since the All-Star break. The right-hander has been particularly locked in of late, not allowing a run in 15 innings.