NEW YORK -- Billy Wagner barely got out of trouble in his previous outing. Not this time.
"Just one of those nights where I didn't make the pitches," Wagner said. "I was trying to go up and in. It was probably more middle. I'm just not locating very well."
Carlos Beltran hit a three-run homer in his return from the disabled list, giving the Mets the 3-2 lead they handed to Wagner (1-1) in the ninth. After entering with a streak of 21 scoreless innings, he couldn't hold it.
Miguel Olivo hit a leadoff single and pinch-hitter Jason Wood walked with one out. Ramirez, who began the day leading the NL with a .340 batting average, drove a 1-2 pitch over Beltran's head in center field to score both runners. The 2006 NL Rookie of the Year pumped his fist as he pulled into second base.
"I like the pressure moments," Ramirez said. "I was looking for a mistake and I got it."
It was Wagner's second blown save in 28 chances this season. The left-hander escaped a bases-loaded, none-out jam to save a 4-3 victory over Atlanta on Wednesday night. He hadn't allowed a run in 20 outings since June 15.
"Billy's been outstanding all year. You expect him to close the game," Mets manager Willie Randolph said.
Matt Lindstrom (2-3), a former Mets farmhand, worked a scoreless inning for the win and Kevin Gregg got three quick outs for his 25th save in 27 opportunities. He retired Luis Castillo, Beltran and David Wright in order.
"It feels good because we need it," Ramirez said. "I don't like to be in last place."
Daniel Barone had a chance to win his major league debut for Florida, taking a 2-0 lead into the fifth before bad defense and a bad pitch did him in on an unseasonably damp, chilly night at Shea Stadium.
Jose Reyes led off and reached on a throwing error by second baseman Dan Uggla, the Marlins' 94th error this season. They began the day leading the majors in that category.
Castillo followed with a bunt single that third baseman Miguel Cabrera was slow to field, and Beltran drove a 2-1 pitch to right-center for his 20th home run.
The star slugger had been out since July 25 because of a strained muscle on his left side. The NL East leaders waited to see how Beltran felt after working out Friday afternoon before deciding whether he would play. About 40 minutes before the scheduled first pitch, the team announced he had been activated.
"I feel great. It's bad that we lost, but I'm happy that I'm back," Beltran said. "I was driving my wife crazy."
Brian Lawrence, the latest Mets pitcher trying to secure the No. 5 spot in the rotation, settled down after a shaky start. He lasted six innings, allowing two runs and eight hits while striking out six in his second start for New York since being called up from Triple-A New Orleans. He beat Milwaukee 12-4 last Thursday.
"Brian did a good job," Randolph said. "He showed when he hits his spots, he can be pretty good. He's had two quality starts."
Moises Alou's two-out infield single in the fifth chased Barone, called up from Triple-A Albuquerque earlier in the day. The 24-year-old right-hander from California shook hands with his new teammates in the clubhouse about 2 ½ hours before the game and had a vocal cheering section behind the plate that included his family and girlfriend.
He allowed two earned runs and five hits with four walks and four strikeouts.
"Emotions were fine. They were perfect. Just after the first pitch, it was a lot better," Barone said. "It's a dream to me still right now. It really hasn't hit me."
Barone's grandfather, Dick Barone, played three games for Pittsburgh in 1960, going 0-for-6 in his only big league at-bats. He took home a World Series ring after the Pirates upset the New York Yankees.
Ramirez opened the game with a single and stole two bases before scoring on Willingham's bloop single. Hermida added an RBI single in the second, but Florida left the bases loaded when Cabrera grounded weakly to Lawrence on a checked swing.
- RHP Ross Wolf also made his big league debut when he relieved Barone and retired his only batter.
- The Mets placed utility player Marlon Anderson on the bereavement list. Anderson traveled to Alabama for his grandmother's funeral.
- The Marlins optioned RHP Mauro Zarate to Albuquerque.
- The gametime temperature was a blustery 61 degrees.