LOS ANGELES–It wasn’t quite the most dramatic three-run home run Andrew McCutchen has hit against the Dodgers this season, but it had a chance to be the most important.

With Los Angeles leading 3-0 in the top of the eighth Wednesday, McCutchen smacked a hanging curveball off Caleb Ferguson to deep left center field to tie the game and offer the Giants another chance to secure a comeback win at Dodger Stadium.

They spent the next four innings looking for their brooms, but the Giants failed to finish off a sweep as Brian Dozier’s sac fly brought home Yasmani Grandal in the 12th inning to cap off a 4-3 Dodgers win.

“It was a heck of a series, it really was,” manager Bruce Bochy said. “A hard-fought series. These guys, I couldn’t be prouder of them. Down three to come back and tie the game, Cutch came through in a huge way.”

On April 7, McCutchen introduced himself to Giants fans by capping off a six-hit night with a walkoff three-run home run in the 14th inning of a 7-5 win. Dodgers reliever Wilmer Font took McCutchen to 12 pitches in that at-bat, but Font was soon jettisoned and has since played for two other major league teams.

Unlike Font, the issues in the Dodgers bullpen aren’t going anywhere. But Wednesday, it was Dozier’s turn to experience the glory McCutchen felt in lifting his new team to a victory.

The Giants dropped 5.5 games behind the first-place Diamondbacks with the loss, and now feel an even greater sense of urgency with just 40 games left to play.

“We’ve got to hope for these guys to beat up on each other,” starter Derek Holland said. “It’s a tough division, it’s a tough race and the way it’s playing out you can tell it’s going to come down to the final weeks.”

Wednesday’s game marked the seventh straight in which a Los Angeles reliever has blown a lead, and the third straight in which the Giants have either taken the lead or tied a game with runs in the eighth inning or later.

The Giants had bullpen troubles of their own, but when they tempted fate by allowing Mark Melancon to pitch to Dodgers slugger Manny Machado in the 10th inning, Melancon survived and struck out the power-hitting shortstop.

“He really made a great pitch there at the end,” Bochy said. “Machado’s swinging the bat well and it’s a tough position there to walk him again.”

McCutchen’s three-run blast bailed out Giants rookies Reyes Moronta and Ray Black, who combined to allow three runs in the two frames leading up to the eighth.

McCutchen wasn’t the only right fielder who made an impact in Wednesday’s game, as Yasiel Puig turned home plate into his personal stage for the second straight night.

After Puig and Giants catcher Nick Hundley started a heated exchange at the plate Tuesday, Puig had the dish all to himself in the sixth inning of Wednesday’s game.

As McCutchen corralled a Joc Pederson flyout off Reyes Moronta, Puig sprinted home from third base and raised his arms in celebration as he scored the first run of the game. The flamboyant outfielder emphatically slapped hands with Pederson before retreating to the home dugout to continue the party.

The sixth inning run squandered a scoreless outing from Holland, who expressed confidence the Giants can build momentum from their play in Los Angeles.

“This is a big road trip,” Holland said. “We’ve got to take advantage of where we are in the season, we’ve got to push and get all the wins we can. The goal is gain as much ground going into this.”

Holland labored through 4 2/3 intense innings at Dodger Stadium Wednesday and threw 55 strikes. His center fielder Gorkys Hernández threw one too, and that’s how Holland kept the Dodgers off the board.

With two on and one out in the fifth, Holland allowed a single to Dodgers left fielder Matt Kemp. As Brian Dozier raced around third base, Hernández collected the ball and threw a 95-mile per hour laser to catcher Buster Posey. Home plate umpire Stu Scheurwater initially ruled Dozier safe, but a replay review overturned the call and preserved the 0-0 tie.

“I got to watch it all the way in,” Holland said. “I thought we had him and that’s why when he called him safe, it might have just been something I didn’t see. Obviously the replay came back the way we wanted it.”