MIAMI -- The rain didn't dampen Andrew Miller's spirits -- or his pitching.
Miller (2-2) was perfect through four innings, retiring the first 12 batters on just 33 pitches. He allowed one earned run and four hits in 5 2/3 innings and won for the first time in four starts.
Most of the game was played in a steady drizzle.
"It felt good to go out there and I cruised for a few innings," Miller said. "The big thing for me was I've been struggled a lot out of the stretch lately. I felt like when I was in the stretch I was making a lot of good pitches. I was able to command everything."
Down 5-2, the Giants loaded the bases in the ninth against closer Matt Lindstrom. Reliever Leo Nunez gave up Aaron Rowand's two-run single before striking out Edgar Renteria to end it and get his second save.
"We had the tying run on third and we were still fighting," Giants manager Bruce Bochy said. "I thought the guys did a good job of battling out there."
The start of the game was delayed 84 minutes because of rain.
"It's hard to pitch in the major leagues when it's perfect conditions," Marlins manager Fredi Gonzalez said. "I commend [Miller] on how well he handled the situation."
It was 2-all when Ramirez hit a one-out double in the Marlins fifth off Jonathan Sanchez (2-5). Jorge Cantu followed with a go-ahead double and Cody Ross walked.
Justin Miller relieved and Ronny Paulino hit a two-run double.
"You're going to miss some pitches and they're going to make you pay," said Sanchez, who had a season-high seven strikouts.
Bengie Molina led off the fifth with a double. After Pablo Sandoval hit an infield single, Andres Torres drove a fly ball into the right-center field gap that drove in Molina and Sandoval.
Torres bumped into first baseman Cantu while heading for second and second-base umpire Fieldin Culbreth immediately called interference. Torres continued to run but stumbled and fell between second and third and was tagged in a rundown.
Torres was awarded second base because of the interference call, but Miller retired the next two batters to end the inning with the game tied.
"We didn't give up and that's all you can ask for," Molina said.
Florida took a 2-0 lead in the third. Chris Coghlan led off with a single, stole second and scored on Ramirez's double. Dan Uggla added an RBI double.
Rowand singled in the sixth to extend his hitting streak to a career-high 16 games, the longest active hit streak in the majors.
After the game, the Marlins optioned right-hander Tim Wood to Triple-A New Orleans to make room for Ricky Nolasco. Nolasco will start Sunday's game against the Giants.
Marlins CF Cody Ross made his fourth great catch in as many games when he made an over-the-shoulder grab on Molina's drive near the 434-foot mark in the second inning. ... Sanchez has received only nine runs of support over his last seven starts. ... The Giants have had four consecutive games affected by weather delays.