New York, which began the night tied with Milwaukee for the lead in the National League wild-card race, moved within a game of idle Philadelphia in the Eastern Division race.
A three-run homer by Micah Hoffpauir gave Chicago a 6-3 lead in the seventh, but the Mets rallied to tie the game in the eighth and then won it in the ninth against Kevin Hart (2-2).
Reyes singled off Hart to open the ninth, but Daniel Murphy and David Wright both struck out. Reyes stole second while Wright was batting and Carlos Delgado was walked intentionally to get to Beltran.
Beltran hit a sharp liner on a 2-0 pitch that glanced off the glove of Hoffpauir at first base and into right field, delivering Reyes with the winning run.
Joe Smith (6-3), the Mets' sixth pitcher, worked the top of the ninth to get the win.
Ryan Church doubled home two runs for the Mets in the fourth and then scored the tying run in the eighth on a single by Robinson Cancel.