Livan Hernandez (2-1) pitched the 10th and picked up the win. He struck out John Buck, got Scott Cousins to fly out to center, but Jose Reyes connected on a 3-1 pitch and homered into the second tier above the Marlins bullpen in right. Donovan Solano struck out to end the inning.
Ryan Braun, who hit a three-run homer in the sixth, struck out and on the play Carlos Gomez stole second. Ramirez hit a 0-1 pitch off the wall in center. His offense lifted the Brewers, who had blown a seven-run lead.
PIRATES 8, ASTROS 7
PITTSBURGH -- Drew Sutton hit a one-out solo homer in the bottom of the ninth and the Pirates improved to eight games over .500 for the first time in 20 years with a win over the Astros.
Acquired via waivers last week, Sutton homered for the first time since Oct. 3, 2010, lifting the Pirates to their sixth walkoff win of the season, the second via a home run.
The Pirates rallied from deficits of 4-0 and 6-2 to take a 7-6 lead on a Garrett Jones two-run homer in the seventh. But with Houston down to its last strike in the ninth, pinch-hitter Jason Castro drove in Jed Lowrie with a double.
Andrew McCutchen continued his recent torrid pace by going 3 for 4 with a home run, taking over the National League batting lead at .360.
METS 11, PHILLIES 1
Niese (7-3) pitched a season-high eight innings and gave up three hits, one a homer to Carlos Ruiz. His hit in the second inning put New York up for good.
The Mets put on a clinic of clutch hitting and slick fielding in handing the Phillies their sixth straight loss. The only thing they did wrong was run into two outs on the basepaths.
Daniel Murphy finished a homer short of the cycle, doubled twice, drove in four runs and made a leaping catch and diving stop at second base.
NATIONALS 9, GIANTS 3
WASHINGTON -- All-Star shortstop Ian Desmond hit his 14th home run, and the Washington Nationals became the latest team to beat up on Tim Lincecum, pounding the struggling right-hander hard early and often.
The opener of the three-game series between first-place teams was barely a contest. Jordan Zimmermann (5-6) pitched a rain-shortened six innings and again enjoyed the generous run support that had evaded him for so long, ensuring the Nationals would wake up on the Fourth of July with a 3½-game cushion over the New York Mets atop the NL East.
Lincecum (3-9) allowed eight runs and nine hits in 3 1-3 innings. Seven runs were earned, making it the worst start ERA-wise in his major league career.
BRAVES 10, CUBS 3
ATLANTA -- Newly chosen All-Star Chipper Jones delivered his first five-hit game in a decade, driving in four runs and leading the Braves over the Cubs.
Jones was added to the NL All-Star roster before the game. The 40-year-old third baseman replaced injured Dodgers outfielder Matt Kemp.
Jones, who plans to retire after this season, went 5 for 5 for his third career five-hit performance and first since Aug. 11, 2002.
After singling in the eighth inning, Jones was lifted for pinch runner Juan Francisco. Jones tipped his batting helmet as he received an ovation on his way to the dugout. He emerged from the dugout for another wave to the fans as the cheers continued.
ROCKIES 3, CARDINALS 2
Matt Belisle retired four in a row to end the eighth, the biggest out coming on Holliday's groundout with two runners on.
Rafael Betancourt worked out of trouble in the ninth for his 13th save in 17 chances. He had blown three of his last five save opportunities, but got Jon Jay to look at strike three with two on for the final out.
PADRES 9, DIAMONDBACKS 5
PHOENIX -- Chase Headley doubled in three runs and the Padres roughed up Arizona rookie Trevor Bauer in his home debut, winning their fourth straight and sending the Diamondbacks to their fourth loss in a row.
Padres starter Andrew Cashner left the game after two innings with a strained muscle in his right side. Leading 2-0 at the time, the Padres scored five in the fourth to break the game open.
Yonder Alonso hit a two-run homer for San Diego.
Bauer (0-1), the third pick overall in last year's draft, allowed six earned runs and six hits in 3 1-3 innings.
REDS 3, DODGERS 1
It was 1-all in the seventh when James Loney singled with one out. Cruz followed with a drive to the gap in left-center and Loney barely getting his foot on the plate after catcher Ryan Hanigan stuck out his left leg to block him.
Cruz continued to third on the relay from shortstop Zack Cozart, then broke for home as Tony Gwynn Jr. tried to put down a suicide-squeeze bunt. Cueto's pitch sailed off the tip of Hanigan's glove and to the backstop.
Copyright 2012 by The Associated Press
This story is from ESPN.com's automated news wire. Wire index
MORE MLB HEADLINES
- Mets rookie P Wheeler wins 1st career start
- Red Sox put P Buchholz (neck strain) on DL
- Yanks' Tex goes on DL; surgery for Youkilis
- O's homer twice off Verlander to top Tigers