Omar Infante went 2-for-4 with an RBI and two runs scored while Logan Morrison added a solo shot for the Marlins, who snapped a four-game slide.
Florida third baseman Emilio Bonifacio extended his hitting streak to 22 games thanks to a 2-for-4 night that saw him score twice.
Clay Hensley was pulled after five innings as he gave up two runs on four hits with four walks. Burke Badenhop (2-1) got the win despite giving up a run and three hits over 1 2/3 innings.
Jose Reyes went 3-for-5 with a solo home run and three runs scored while David Wright drove in two for the Mets, who had won three of four coming into the game. Both players had come off stints on the disabled list earlier in the week.
Chris Capuano (8-10) was strong through five innings, but saw things come apart in the sixth inning. He finished the frame, but left after that and was charged with four runs and six hits with three walks and six strikeouts.
With no score in the fifth inning, the Mets grabbed the lead thanks to Wright. The first two batters recorded outs, but Reyes beat out an infield single and quickly stole second. After walks to Justin Turner and Carlos Beltran loaded the bases, Wright punched a single to left that easily scored Reyes, while Turner made it home ahead of the throw for a 2-0 lead.
The sixth inning, though, saw the Marlins move ahead. Bonifacio led off with an infield single and Infante scored him with a triple to right-center. Sanchez then crushed the first pitch he saw over the left-field wall for the lead and Morrison hit a 2-1 pitch over the right-field wall for a 4-2 advantage.
New York got one back in the seventh when Beltran scored Reyes with a single to left, but Florida blew it open in the bottom of the frame.
After the first two batters struck out, Bonifacio kept the inning alive with an infield single and stole second. Infante then hit a sharp shot to third that Wright made a diving stop on, but his throw to first bounced several times and got past Daniel Murphy, scoring Bonifacio. Sanchez followed with his second two-run home run of the game for a 7-3 lead.
John Buck singled home DeWayne Wise in the eighth to give the Marlins a five- run advantage.
The Mets didn’t go quietly in the ninth, as Lucas Duda led off with a home run, his first of the season, and Reyes followed with a shot to right, but Leo Nunez set down the next three batters to seal the win.