Updated

Kelly Shoppach knocked in the go-ahead run with a single to highlight a four-run ninth inning, as the New York Mets beat the Miami Marlins, 5-3, in the middle test of a three-game set.

With runners on first and second Lucas Duda ripped a single to center to score Daniel Murphy.

After Mike Baxter popped out, Andres Torres walked to load the bases. Shoppach delivered a base hit up the middle. Marlins center fielder Justin Ruggiano charged the ball to attempt a throw home, but the ball bounced off the heel of his glove and rolled past him, allowing all three runners to score.

"Things like that in that situation in this game, no matter where you are in the season, those are always big moments," Shoppach said. "Not only personally, but as far as the momentum we have going for us."

Frank Francisco pitched a perfect ninth to nail down the win for New York. It was his 23rd save of the year and sealed New York's sixth win in seven games.

Ramon Ramirez (3-3) earned the victory, despite giving up a run in the bottom of the eighth inning.

Josh Johnson worked eight strong innings, allowing just one run on three hits while striking out four, but Steve Cishek (4-2) couldn't close the door in the ninth.

"It is disappointing, we played awesome today," Cishek said. "Getting the extra run makes it a little more comfortable, but they squared it up pretty good and ground balls didn't find anyone they got the job done. It happens."

The Marlins got on the board in the third when Bryan Peterson doubled to score Donovan Solano.

New York tied the game in the fifth when Baxter scored on a Josh Thole groundout. Baxter broke up Johnson's no-hit bid with a leadoff double to left- center field then moved to third when Torres grounded out.

Miami took the lead once again in the sixth when Jose Reyes scored on Giancarlo Stanton's infield single. Back-to-back base hits from Reyes and Carlos Lee put runners on the corners before Stanton cued one down the first base line and beat Mets pitcher Jeremy Hefner to the bag.

The Marlins added another run in the eighth when Lee singled home Reyes.

"These guys are going to play it out, they're going to play it out hard," Mets manager Terry Collins said. "I just think there is a lot of fight left."

Game Notes

New York leads the season series 7-4 ... Prior to the game the Mets recalled catcher Mike Nickeas and infielder Zach Lutz from Buffalo Triple-A ... Reyes stole his 400th career base ... Hefner started for New York. He allowed two runs on six hits and struck out four ... Johnson is winless in his last five starts. His last win came Aug. 3 against the Washington Nationals.