Adam LaRoche and Jack Wilson had three hits apiece for Pittsburgh, which came back from a 5-0 deficit to win for only the second time in six games.
Wilson Valdez had two hits and a career-high three RBIs for the Mets, who fell to 22-2 when leading after seven innings. Jeremy Reed added two hits and scored two runs.
The bottom of the eighth had to stir up bad memories of last season for Mets fans, but bullpen implosions have been rare this season.
Adam LaRoche led off the inning with a double off Pedro Feliciano. After Eric Hinske grounded out, Mets manager Jerry Manuel replaced Feliciano with J.J. Putz (1-4).
The Pirates responded with four consecutive singles up the middle. Andy LaRoche's infield single to second drove in brother Adam. After Jason Jaramillo's hit, Wilson tied with a single to center and pinch hitter Delwyn Young put Pittsburgh in front 6-5.
Shortstop Wilson Valdez's error led to another run and Nate McLouth added a sacrifice fly to make it 8-5.
Putz failed to record an out, and was charged with four runs and four hits.
Tom Gorzelanny (3-1) got one out to record the win, and Matt Capps pitched the ninth for his 11th save.
Valdez helped New York get off to a quick start. He tripled in Reed in the second inning and scored on Brian Schneider's to give the Mets a 2-0 lead. He hit a two-out, two-run double off Ian Snell in the third.
Livan Hernandez, coming off a complete-game effort against the Washington Nationals, allowed three runs and seven hits in 5 2-3 innings for New York.