San Francisco, CA (SportsNetwork.com) - Justin Maxwell's RBI single in the bottom of the 10th gave the San Francisco Giants a 3-2 win over the Los Angeles Dodgers on Thursday.

The Dodgers sent Juan Nicasio (0-1) to the mound in the 10th. Angel Pagan singled and stole second before Brandon Belt was intentionally walked. Maxwell, who was robbed of a hit by Howie Kendrick in the eighth, hit a line drive down the left-field line to plate the winning run.

"It's great. We've been fighting all year," Maxwell said. "Every time I go up there I just try to hit it hard."

Brandon Crawford tied the game in the ninth with an RBI triple. Belt also knocked in a run for the Giants, who recorded their first sweep of the season and their first sweep over the Dodgers since May 3-5, 2013.

San Francisco starter Ryan Vogelsong gave up two runs on three hits while striking out five over six innings. Santiago Casilla (2-0) got the win after stranding the bases loaded in the top of the 10th.

Alex Guerrero and Adrian Gonzalez hit solo homers for the Dodgers, who have lost three in a row since a seven-game winning streak. Mike Bolsinger made his Los Angeles debut and allowed one run on five hits while striking out five and walking two over 5 2/3 innings.

The Giants scored one run off Pedro Baez in the ninth to make it a 2-2 game. Casey McGehee led off with a single and was replaced on the basepaths by Matt Duffy, who raced home on Crawford's triple to right-center field. Crawford was stranded, however, when pinch-hitter Gregor Blanco struck out swinging, Norichika Aoki popped out and Joe Panik flied out.

Los Angeles loaded the bases with two outs in the 10th, but Gonzalez struck out swinging.

Guerrero and Gonzalez homered in the second and third, respectively, to make it 2-0 Los Angeles.

The Giants didn't advance a runner past first until the sixth. Panik walked and Pagan singled to put men on first and second with one out. After Buster Posey struck out looking, Belt hit an RBI single to center. Chris Hatcher took over for Bolsinger and got Maxwell to go down swinging.

San Francisco failed to score after loading the bases in the eighth. J.P. Howell put a runner on first with two outs before handing the ball over to Joel Peralta. Posey and Belt worked consecutive walks to fill the bags for Maxwell, who was robbed of a hit by Kendrick. The second baseman made a great diving catch on a line drive up the middle to keep Los Angeles ahead.

Game Notes

The Giants went 4-6 on a 10-game homestand ... Bolsinger, who was recalled from Triple-A Oklahoma City, went 1-6 with a 5.50 ERA in 10 games (nine starts) with the Diamondbacks in 2014 ... Dodgers catcher A.J. Ellis sat out with a bruised right hand.