MIAMI (AP) -- Barry Zito removed an unwanted zero from his record.
"That's why we're here for, to band together and win games together," Zito said. "You can't win games on your own as a pitcher, and you can't win games on your own as a hitter."
Zito (1-8) allowed one run and three hits in 6 1/3 innings. He struck out five and walked four for his first victory since Sept. 30, 2007, when he defeated the Los Angeles Dodgers in San Francisco's season finale.
"It's a result. I try to work on the process, results happen as they may," Zito said.
Making his 10th start this year, Zito avoided becoming the first starter in franchise history to begin a season 0-9. The 2002 AL Cy Young Award winner with Oakland, Zito has been a bust in San Francisco since signing a $126 million, seven-year contract before last season.
After a 10-1 loss against Cincinnati on April 27, which dropped his record to 0-6, Zito was sent to the bullpen. He never made a relief appearance and returned to the rotation May 7.
"I think it was good to take a good, hard look at myself in the mirror and ask myself, what am I going to do about this situation?" Zito said. "It's just going out and being aggressive and being myself."
Giants manager Bruce Bochy already had noticed a change in Zito's performances before Friday's win.
"His last two starts have been better," Bochy said. "I think he's getting on track. ... We're all happy for Z. It's great to get that first win, there's no getting around that."
Rowand drove in three runs, and Molina and Rich Aurilia each had two RBI to lead the Giants.
"It feels good to be able to help, but Barry threw the ball like I remember him throwing the ball," Rowand said. "He pitched his game, he didn't leave anything over the plate."
"I felt we hit some balls hard, right at people," Uggla said. "That's the way it goes sometimes. Zito pitched a great game. You have to tip your hat to him."
Molina and Rowand homered in the fourth, giving the Giants a 7-1 lead and chasing Florida starter Scott Olsen after 3 1/3 innings. Olsen (4-2) allowed seven runs and eight hits, struck out two and walked three in his shortest outing of the season.
"It was one of those nights. I had nothing," Olsen said. "I didn't give my team a chance to win right from the start."
The Marlins also lost starting right fielder Brett Carroll after Rowand's home run. Carroll sprained his right shoulder after hitting the wall while chasing Rowand's shot. Jacque Jones, who joined the club Friday, replaced Carroll.
"I felt like a car wreck when I hit the wall," said Carroll, who wore a sling after the game. "It was not the first time I hit it like that but this one got the best of me."
Castillo hit a solo shot in the eighth.
Rowand's RBI single and Aurilia's two-run double in the third increased the Giants' lead to 5-1.
The Giants got to Olsen quickly with a two-run first. Molina's run-scoring single and Rowand's sacrifice fly gave San Francisco the early lead.
"We saw a lot of pitches up in the zone and we took advantage of it," Molina said.
Uggla drove in both runs for the Marlins, a two-out RBI double in the first and his home run in the ninth.
Molina and Rowand gave the Giants back-to-back homers for the first time this season. ... San Francisco's Omar Vizquel played in his 2,583rd game at shortstop, one behind career leader Luis Aparicio. ... The Giants have won five straight against the Marlins at Dolphin Stadium after a four-game sweep last season. ... Florida's Luis Gonzalez played in his 2,500th game.