Uribe chased Cain with a bases-clearing triple in the third and hit a two-run homer in the seventh. He also drove in seven runs for the Chicago White Sox in a 17-14 loss to the Montreal Expos on June 19, 2004.
"A game like that, you always remember," Uribe said. "I think I was a little lucky too. I'm happy to have a game like that but I like winning more. Right now I am feeling good."
"After we got the lead I felt more comfortable," Ryu said. "I changed my delivery a little and the outcome was not too bad. Everything worked out."
There was a bit of a downer to the big victory, with center fielder Matt Kemp departing due to an irritated left shoulder.
"I just wish I could stay on the field," Kemp said. "I don't ever want to get used to getting hurt. It could have been worse. I felt something weird in my shoulder that scared me. It hurt worse than running into the wall."
Kemp received a cortisone shot and will miss Saturday's game. He will be re-evaluated Sunday.
San Francisco also lost its center fielder when Andres Torres departed with a right calf strain.
"We're getting tested," manager Bruce Bochy said. "Hopefully you get stronger when you're tested. You hate to see what's going on. It's a good group. It's not like they're quitting. They're probably trying a little too hard."
Cain (5-5) was charged with six runs and eight hits in 2 1-3 innings, matching his career low. The right-hander was 5-0 in his previous 11 starts against the Dodgers.
"I'm not going to watch any part of this one," he said.
Ryu (7-3) allowed two runs and four hits over 6 2-3 innings. The left-hander was 0-1 with a 2.70 ERA in his previous five outings.
"Juan got a couple of big hits to give us some breathing room," Dodgers manager Don Mattingly said.
Ryu retired 11 straight between Pablo Sandoval's double in the third and Brandon Belt's double leading off the seventh. He also had an RBI single in the Dodgers' six-run third inning.
Pence had a run-scoring fielder's choice in the first, but Uribe hit a two-run double in the second before Los Angeles broke it open in the third. Ramirez singled in Yasiel Puig and A.J. Ellis drove in Adrian Gonzalez with a base hit in the big inning.
Uribe's fifth homer gave him the most RBIs in a game for the Dodgers since James Loney drove in nine in 2006.
Abreu ended the Giants' 0-for-20 streak with runners in scoring position with his seventh-inning single.
- The Dodgers reinstated OF Carl Crawford from the DL and optioned OF Scott Van Slyke to Triple-A Albuquerque.
- The Giants recalled OF Cole Gillespie from Triple-A Fresno, sent OF Juan Perez to the minors and moved OF Angel Pagan to the 60-day disabled list.
- LHP Ted Lilly (neck strain) will make his second rehab start with Single-A Rancho Cucamonga on Saturday. Mattingly said he'd like Lilly to go five or six innings and throw about 90 pitches.
- The Giants scored a first-inning run for the first time since June 18.
- San Francisco RHP Chad Gaudin (2-1, 2.60 ERA) will come off the disabled list to start Sunday's game.
- Bochy said he's been working on finalizing the NL All-Star list.
- LHP Madison Bumgarner (8-5, 3.08 ERA) starts Saturday's game for the Giants. He's 6-3 in 10 games against the Dodgers. RHP Stephen Fife (3-2, 2.83) gets the start for L. A. He's won his last two starts and beat the Giants in San Francisco last July.