Gregory Polanco singled home the go-ahead run in the 10th inning and the Pittsburgh Pirates ended the Mets' seven-game home winning streak, stopping New York 3-2 Friday night.
The teams went into extra innings at 1-all. Polanco singled off Bobby Parnell (1-2) and Aramis Ramirez hit a sacrifice fly against Carlos Torres.
The NL East-leading Mets scored in the bottom half on Curtis Granderson's sacrifice fly before Mark Melancon finished for his 36th save.
Arquimedes Caminero (3-1) pitched a scoreless ninth for the win.
Neil Walker homered with one out in the Pirates first off Bartolo Colon, sending a drive into the Pittsburgh bullpen.
The playoff-contending homered in their eighth straight game for the first time in a single season since June 2013, STATS said.
Colon wound up pitching seven innings, giving up five hits while striking out seven.
Yoenis Cespedes hit his 20th home run overall, and second since being traded to the Mets, with a tying drive in the sixth.
It was the Mets' 15th long ball in their last 19 games, and tied a franchise record with 67 homers in a season with 67.
Making his second start joining the Pirates, J.A. Happ allowed seven hits in 5 1-3 innings.
Backup catcher Chris Stewart led off the Pittsburgh 10th with a single and was pulled for pinch-runner Starling Marte, out of the starting lineup because of a bruised left hand.
Pinch-hitter Francisco Cervelli sharply singled to left on a full count, sending the speedy Marte to third. Polanco lined Parnell's first pitch up the middle.
Juan Lagares led off the Mets 10th with a double, and a wild pitch set up Granderson's fly. Melancon struck out Cespedes and retired Juan Uribe on a grounder.