Updated

Los Angeles, CA (SportsNetwork.com) - Matt Kemp and Hanley Ramirez each hit their first two home runs of the season and the Los Angeles Dodgers beat the San Francisco Giants, 6-2, to avoid a three-game sweep.

Ramirez, who was 3-for-4 and scored three times, smacked a pair of solo shots, while Kemp slugged a two-run and a solo blast for Los Angeles, which improved to 5-3 on the young campaign.

"It always feels good to hit a home run here. The ball was carrying a little bit tonight," Kemp said.

Zack Greinke (2-0) struck out eight and allowed two runs on six hits over six innings to pick up the win.

Brandon Belt and Hunter Pence each had a solo homer for the Giants, who had their four-game winning streak snapped. Matt Cain (0-1) surrendered five runs on six hits over six frames to notch the loss.

"I tried to attack guys, but I'd like to keep the ball in the park. I just have to make good pitches," Cain said.

Kemp put the Dodgers on the board in the second when he launched a two-out solo shot over the wall in left-center and LA pushed across three more in the fourth.

Ramirez belted a one-out solo homer to left to make it 2-0 and after Adrian Gonzalez doubled, Kemp cracked a two-run blast to right-center two batters later for a 4-0 advantage.

Belt and Pence's solo shots in the sixth cut the deficit in half, but Andre Ethier lifted a sacrifice fly to center in the bottom half to increase the spread to 5-2.

Ramirez's liner cleared the wall in center in the eighth and Kenley Jansen fired a scoreless ninth to seal the outcome.

Game Notes

Ramirez registered his 15th career multi-homer game ... The Dodgers were 1- for-5 with runners in scoring position, while San Francisco finished 0-for-2 with RISP.