Lincecum (11-9) walked three, struck out 10 and hit a batter while lowering his league-leading road ERA to 2.08. He has given up one run or less in six of his last seven starts overall.
Javier Vazquez (7-10) surrendered three runs and five hits in seven innings. He struck out 10 and threw two wild pitches. It was his eighth quality start in his last 11 outings.
Keppinger's first inning shot extended San Francisco's major league record of consecutive solo home runs to 21.
The Giants entered having lost 11 of 14. The Marlins snapped a seven-game losing streak on Friday night.
Ross led off with a single and advanced on Vazquez's wild pitch. With two out, Huff lofted a fly down the line where Logan Morrison failed to catch the ball as he ran into foul territory.
The Giants took a 2-0 lead in the fifth when Nate Schierholtz scored on Vazquez's wild pitch.
Keppinger hit Vazquez's first pitch down the left-field line for a home run with one out in the first.
Notes: The Giants placed OFAndres Torres
(lower right leg contusion) on the 15-day disabled list and recalled 1BBrandon Belt
from Triple-A Fresno. ... Giants OFCarlos Beltran
(strained right hand) missed his fifth straight game. ...Ryan Vogelsong
(9-2, 2.48 ERA) will opposeChris Volstad
(5-8, 5.58) in Sunday's series finale. Florida recalled Volstad from Triple-A New Orleans on Friday. The Giants will try to snap a four-series losing streak. ... Before the sixth, former Miami Dolphins QB Dan Marino peeled the Game Countdown on the left field wall to show No. 16, as in 16 games left at Sun Life Stadium before the Marlins move to their new ballpark next year.