Even without three of their biggest bats, Will Smith and the Los Angeles Dodgers found a way to rally for a big victory over the San Francisco Giants.

Smith connected for a three-run homer in the bottom of the ninth inning as the Dodgers rallied from five runs down to defeat the Giants 8-6 on Tuesday night in the second game of a pivotal series between NL West rivals.

"That was huge for us. This is a huge series. We stuck with it and came back and found a way to win a game. That’s our biggest win of the year so far," said Chris Taylor, who hit two home runs while going 3 for 4 with three RBIs.

Los Angeles evened the four-game set at one apiece and moved within one game of the first-place Giants despite missing Mookie Betts, Justin Turner and Max Muncy. Betts was out of the lineup for the third straight day due to a hip pointer, while Turner and Muncy eventually ended up leaving the game after each getting hit by a pitch.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

"We have a lot of depth and guys that we can run out there," Smith said. "With the lineup and taking good at-bats, that keeps us in the game and we can walk away with the win."

Taylor and Matt Beaty drew walks from Tyler Rogers (1-1) before Smith drove an 0-1 slider into the stands in left-center for the third walk-off homer and first pitch-hit shot of his career.

"I’m going to have a Bud Light and rinse this one off and be ready to get back at it tomorrow," said Rogers after his fifth blown save of the season.

In a game that featured seven home runs, Los Angeles trailed 6-1 in the fifth before coming back. Taylor — who had the third multi-homer game of his career — hit a solo shot off Alex Wood in the fifth and a two-run drive against John Brebbia during a three-run sixth.

Giants manager Gabe Kapler said he still has faith in Rogers.

"Everybody has a hiccup. So obviously, it’s a disappointing loss," Kapler said. "I can’t wait to get him back out there so we can turn the page and put this one behind."

Alex Dickerson and Mike Yastrzemski each hit a two-run homer for San Francisco. LaMonte Wade Jr. and Thairo Estrada added solo shots for the Giants, who lead the majors in home runs (142) and percentage of runs scored via the long ball (52.9%).

Jimmie Sherfy (2-0) got the win.

The Dodgers grabbed a 1-0 lead in the first on an RBI single up the middle by Muncy with the infield drawn in.

The Giants quickly responded in the second. After Wilmer Flores started the inning with a double off the center-field wall, Dickerson lofted a changeup from Darien Núñez into the right-field seats for a 2-1 lead.

San Francisco's other three homers came off Josiah Gray, who was making his major league debut. Wade, the second batter Gray faced, greeted him with a solo drive to right in the third inning on the eighth pitch of his big league career.

Estrada — taking the place of injured All-Star shortstop Brandon Crawford — led off the fifth with a homer to center on the first pitch. Yastrzemski then extended the Giants' lead to 6-1 with a two-run drive to right.

HOME RUN DERBY

According to Sportradar, it was the first time since 1958 in the Giants vs. Dodgers rivalry that the teams combined to hit seven or more home runs in a game. It was only the eighth time in the 2,527 regular-season games in the series that it has happened.

FOR STARTERS

Wood allowed three runs and six hits in five innings, and was a bit erratic with three hit batters, including Turner (bruised left knee) and Muncy (bruised right shoulder). Dodgers manager Dave Roberts said Turner is expected to miss Wednesday's game.

Roberts decided to use Núñez as an opener before going to Gray. Núñez allowed two runs and two hits in two innings. Gray struck out seven in four innings but was charged with four runs and four hits.

WEB GEM

Dodgers right fielder Zach McKinstry made a diving catch in the second to rob Donovan Solano of a hit.

TRAINER'S ROOM

Giants: 2B Tommy La Stella (left hamstring strain, right thumb) will resume a rehab assignment at Triple-A Sacramento on Thursday. ... RHP Aaron Sanchez (right biceps tightness) threw a bullpen before the game.

Dodgers: Roberts said SS Corey Seager (broken left hand) felt good after taking batting practice Monday, but an activation date remains to be determined.

UP NEXT

Dodgers LHP Julio Urías (12-3, 3.78 ERA), tied for the major league lead in wins, is 1-3 in 11 career starts against the Giants. San Francisco RHP Logan Webb (4-3, 3.54) is 3-0 in his last five starts.