LOS ANGELES -- It was looking all too familiar to the Los Angeles Dodgers. Another lead lost, another reliever buckling in a big moment.
Instead, the relievers came through with four scoreless innings that enabled Brian Dozier's sacrifice fly to finally drive in the winning run in the 12th for a 4-3 victory that snapped a five-game losing streak Wednesday night.
"A big relief to say the least," Dozier said. "A needed win."
The loss ended a three-game winning streak for the Giants, who were looking to sweep the three-game series against their longtime rivals.
"It was a hard-fought series," manager Bruce Bochy said. "It's a tough loss, no question. But you have to look at how we came back, and a lot of good things. We just couldn't quite finish it."
The Dodgers received six scoreless innings from left-hander Hyun-Jin Ryu during his first start in more than three months and took their first lead with a run in the sixth after Yasiel Puig led off with a double. Puig, ejected Tuesday after a scuffle with Giants catcher Nick Hundley, went to third on a flyout and scored on pinch-hitter Joc Pederson's sacrifice fly.
McCutchen's 14th home run came against rookie reliever Caleb Ferguson, and the Dodgers would have to be forgiven if they thought a repeat of the past five games was in the works, with the bullpen taking the loss in each one.
"If that game gets away from us, it's really tough," Turner said. "It's a little bit of a monkey off our shoulders."
Pedro Baez (4-3) threw the final two scoreless innings to earn the win.
Ryu had not pitched since severely injuring his groin on May 2, but he was dominant. The left-hander held the Giants to three hits and struck out six. He did not walk a batter.
"You win with starting pitching," Dodgers manager Dave Roberts said. "Overall our starting pitching has been lights-out. To get him back is a big boost for our team. ... The guy is a big-game pitcher."
SEARCHING FOR OFFENSE
The Dodgers scored only three runs in the first two games of the series and left 17 runners on base Wednesday. As much as their bullpen has struggled lately, so has the lineup.
Still, they remain confident.
"This team is built to win and we're going to put a hot streak together at some point," Kemp said.
"We're still playing good baseball," Dozier said. "Last time I checked, most winning streaks started after a loss."
Giants: SS Brandon Crawford returned to the lineup after sitting out one game in concussion protocol. ... 1B Brandon Belt (hyperextended knee) returned to the lineup. He was activated Tuesday, entered in the eighth when Hundley was ejected and scored the decisive run on a close play at the plate. ... RHP Jeff Samardzija (right shoulder inflammation) threw a 30-pitch simulated game Tuesday and is scheduled to throw to hitters Friday before beginning a rehab assignment.
Dodgers: Placed RHP Ross Stripling on the 10-day disabled list with two compressed disks in his lower back, retroactive to Friday. Stripling said he's had the problem since college. ... LHP Tony Cingrani (left shoulder strain) was transferred to the 60-day DL. ... RHP Daniel Hudson (right forearm strain) is scheduled to come off the disabled list Friday. ... All-Star closer Kenley Jansen (irregular heartbeat) threw a second bullpen. He is scheduled to see his cardiologist on Monday. ... LHP Julio Urias (left shoulder surgery) was scheduled to throw two-plus innings in a rehab start, but lasted only 1 1/3 innings.
Giants: RHP Dereck Rodriguez (6-1, 2.25 ERA) starts Friday when San Francisco opens a three-game series in Cincinnati. The Giants are 9-3 in his past 12 starts.
Dodgers: RHP Walker Buehler (5-4, 3.32) is scheduled to pitch Friday in the opener of a three-game series at Seattle. Buehler has a 2.80 ERA as a starter, limiting opponents to a .211 batting average.
More AP baseball: https://apnews.com/tag/MLBbaseball and https://twitter.com/AP-Sports
Donaldson lights it up with 3-run dinger
Josh Donaldson continues to be hot at the plate with a deep 3-run home run.
Braves strike early with Donaldson homer
Josh Donaldson takes Shane Bieber deep with a solo home run in the first inning.
Hedges, Padres beat Reds 4-3 to end 6-game losing streak
Austin Hedges homered and Wil Myers hit a go-ahead, two-run double in the four-run third inning for the San Diego Padres, who beat the Cincinnati Reds 4-3 on Sunday to snap a six-game losing streak.
La Stella hits 2 home runs vs. Mariners
Tommy La Stella has a big game as he hits 2 solo shots to lead the Angels to a 8-6 win over the Mariners.
Padres score 4 runs in the 3rd inning
Austin Hedges' homer along with doubles from Wil Myers and Eric Hosmer give the Padres a 4-1 lead over the Reds.
Angels power past Mariners 8-6 to end 6-game losing streak
Tommy La Stella hit two home runs and the Los Angeles Angels held on for an 8-6 win over the Seattle Mariners on Sunday to end a six-game losing streak.