The Florida Marlins have climbed back to .500, no small feat after a 1-19 free-fall in June sent them spiraling toward a low point of 11 games under.

Rookie second baseman Justin Turner committed a crucial throwing error in the ninth inning, allowing the Marlins to score two runs and rally past the New York Mets 4-3 on Tuesday night.

"We've given a few away like that one tonight. We're appreciative to get it," Florida manager Jack McKeon said.

Omar Infante hit a pair of solo shots for Florida, giving him three homers this season, but star shortstop Hanley Ramirez left the game in pain after spraining his left shoulder while diving for a ball in the outfield.

He is expected to miss Wednesday night's game — and maybe more.

Jose Reyes homered and Chris Capuano pitched six effective innings for the Mets, who have lost four straight following a five-game winning streak.

New York led 3-2 entering the ninth, but Jason Isringhausen quickly got in trouble with a leadoff walk to Logan Morrison. Mike Stanton popped out before Mike Cameron's single put runners at the corners.

Isringhausen (2-2) hit John Buck with a pitch, loading the bases, and pinch-hitter Bryan Petersen hit a slow grounder to second base. Turner charged the ball and Buck stopped in the middle of the basepath, so Turner tossed to first.

But with Buck in the way, the throw went high and wide past Lucas Duda, handing Florida a 4-3 lead.

"He did an outstanding job of baserunning," Turner said. "I don't necessarily think that I made a bad choice, I just made a bad throw."

Just before the play, first base coach Perry Hill reminded Buck to hold up on a slow grounder to second and make sure he didn't run into a tag by Turner, who said he "kind of got into panic mode."

"He looked me right in the eye, then he decided to throw. Maybe it was my Jedi mind trick right there, I don't know," Buck said.

Randy Choate walked pinch-hitter Ronny Paulino to start the bottom of the ninth before Leo Nunez came on. Nunez, who blew a save Monday night, got pinch-hitter Daniel Murphy to ground into a 1-6-3 double play and struck out Jason Pridie for his 31st save in 35 chances.

A cascade of boos from the crowd of 33,297 was directed at the Mets after the final out.

Steve Cishek (2-1) pitched two scoreless innings for the win, helping the Marlins (55-55) get back to .500 for the first time since June 12.

"That's where we wanted to be. Now we can start a new season," said the 80-year-old McKeon, who took over when Edwin Rodriguez resigned on June 19.

Florida tied the Mets for third place in the NL East. The Marlins also improved to 32-25 on the road and 4-0 at Citi Field, where New York is 22-28 this season.

"It's like they went through that really bad streak and ever since they haven't let up," Capuano said.

Duda's sacrifice fly off reliever Brian Sanches put the Mets up 3-2 in the sixth.

Moments earlier, Ramirez injured his shoulder. He was chasing Angel Pagan's pop fly to shallow left when he lunged for the ball at the last minute and hit the ground hard. The ball dropped for a single and Ramirez tumbled over, grabbing his left shoulder as he writhed in pain.

The three-time All-Star and 2009 NL batting champion stayed down for several minutes. He walked off the field with McKeon and a trainer, holding his left arm gingerly to his side.

"It is going to be sore," Ramirez said. "Hopefully it is nothing bad and I can come back quick."

Greg Dobbs entered the game at third base and Emilio Bonifacio shifted from third to shortstop. Ramirez, who spent time on the disabled list earlier this season with a lower back strain, is day to day.

"We've got other people here ready to step in. It gives Dobbs an opportunity to play a little bit," McKeon said.

Capuano helped the Mets tie it at 2 with a leadoff single in the fifth. He advanced to third on Turner's ground-rule double and scored on a groundout by David Wright.

New York went ahead after Pagan's bloop single with one out in the sixth. Pagan stole second, went to third on a wild pitch by Sanches and scored on Duda's liner to right.

Duda tied Monday night's game on a two-run homer off Nunez with two outs in the ninth, but Stanton's grand slam off Isringhausen in the 10th sent Florida to a 7-3 victory.

NOTES: It was Infante's fifth career multihomer game. ... Marlins ace Josh Johnson (right shoulder inflammation) is slated to begin throwing again Wednesday in Florida. He hasn't pitched since May 16. ... During a pregame session with reporters in his office, McKeon picked up his cell phone to see who was calling, then snapped it shut. "Ahhh, Obama," he deadpanned. "Sign the thing. What are you calling me for?" ... Reyes' fifth homer of the season was his first batting right-handed.