New York ended a five-game losing streak, taking a 5-0 lead through two innings to back up the seven-strikeout performance of starter Jonathon Niese.
Hairston hit a two-run homer as part of the Mets' three-run first inning and he tripled home a run in the fifth. Ike Davis had two RBI for the Mets with a first-inning single and a seventh-inning solo home run.
Niese (12-9) gave up three runs on seven hits in 6 1/3 innings to get the victory. He has won his last two starts after losing three in a row.
The loss went to Jacob Turner (2-4), who lasted five innings. Only three of the six runs allowed by Turner were earned.
New York moved 1 1/2 games in front of Miami in their fight to avoid last place in the National League East.