The Marlins entered with the worst fielding percentage in baseball, and poor defense doomed them again. Florida has 102 errors this season, most in the majors.
Ray Durham hit his 10th home run and Kevin Frandsen added his third for San Francisco, which has won four straight. South Florida native Vinnie Chulk (5-4) got the win after retiring two batters in the sixth, and Brad Hennessey stranded runners on the corners in the ninth for his 12th save in 14 chances.
Josh Willingham had three hits, including his 19th homer, and drove in two runs for Florida. Miguel Cabrera added two hits and two RBIs.
Giants slugger Barry Bonds, who extended baseball's home run record to 760 on Saturday, got the day off. It's uncertain if he'll play in Monday's series finale, another afternoon game.
Rodriguez reached to open the seventh when shortstop Hanley Ramirez bobbled his grounder. Two batters later, Davis' sacrifice bunt was thrown away by Florida reliever Lee Gardner (3-4) for a second error, and the third came on the same play when right fielder Cody Ross' throw to second sailed wide.
Rodriguez and Klesko scored on the botched bunt play. Davis scored, oddly enough, on a nifty defensive play by Ross, who dove over the bullpen wall to catch a fly ball hit by Daniel Ortmeier.
The Marlins got within 6-4 in the seventh on Willingham's homer, then closed to 6-5 in the eighth on Ramirez's RBI popup that fell into short right field. But with the bases loaded, Willingham lined to left for the second out, and Giants reliever Patrick Misch — summoned for a lefty-lefty matchup — got Mike Jacobs to ground out and end the threat.
Florida starter Dontrelle Willis had allowed only nine home runs in 251 innings during daytime starts in his career, but yielded two in the first 2 2-3 innings to fall behind 3-0. Frandsen hit a solo shot with two out in the second, and Durham connected for a two-run homer in the third.
But Willis started Florida's three-run rally against San Francisco starter Noah Lowry in the fifth.
Lowry retired nine straight before Willis singled with one out. He and Ramirez scored on Cabrera's two-out double, and Cabrera came across one pitch later when Willingham doubled to left-center.
Lowry allowed five hits, struck out three and walked five in 5 1-3 innings. Willis — who failed in his bid to win consecutive starts for the first time since April — yielded seven hits and one walk while striking out three in six innings, and needed 116 pitches to complete those.
Notes:@ Klesko didn't enter until the sixth and finished with two hits. ... Florida manager Fredi Gonzalez was ejected after Ross struck out looking to end the fourth. ... Lowry remained unbeaten in August; he's 11-0 in 19 starts in that month. ... Willis' ERA in day games this season rose from 1.69 to 2.45. ... Ross entered hitting .432 against left-handers, but went 0-for-3 against Lowry. ... Attendance was 15,351, about 27,000 off Saturday night's total.