The Dodgers are chasing the San Francisco Giants in the NL West. They caught their rival in one big way by becoming the second team in the majors to clinch a postseason berth.

Max Muncy, Trea Turner and Will Smith homered in an 8-4 victory over the Arizona Diamondbacks on Tuesday night that was their fifth in a row.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

The Giants had locked up a playoff spot a night earlier. The Dodgers secured their ninth consecutive postseason appearance with their eighth straight home win and help from Cincinnati and San Diego, which both lost. The defending World Series champions got it done at home, where their 51-23 record leads the majors.

"It’s definitely something that shouldn't be taken for granted," third baseman Justin Turner said. "At the same time, our focus is on us and taking care of what’s in front of us. That’s probably why I didn’t even realize we had a chance to clinch tonight."

The Giants partied after making the postseason for the first time in five years. The Dodgers kept things low key.

"We did a little Champagne toast, said a few words and acknowledged the fact that it’s a big accomplishment," said manager Dave Roberts, wearing a blue "Built for October" T-shirt. "We got a lot of work to do and this is just the beginning."

The Dodgers finally have their full rotation — led by Cy Young Award contenders Walker Buehler, Max Scherzer and Julio Urías — in place after numerous injuries.

"You win with starting pitching and I believe we have the best starting pitching in baseball," Roberts said. "I love where we’re at."

Tony Gonsolin (3-1) scattered two hits over five scoreless innings, struck out six and walked two.

"I’ve been kind of grinding with the team the whole year," Gonsolin said, "but being able to contribute makes me feel a lot better."

Using teammate Albert Pujols' bat, Muncy blasted his 33rd homer, a two-run shot, off Luke Weaver (3-5) in the third, when the D-backs had two errors. Mookie Betts singled leading off and scored, making it 3-0. Will Smith grounded into a fielder's choice to Weaver, who botched the throw, allowing Corey Seager to score after reaching on a fielding error by Ketel Marte. Weaver bent over and stomped his feet in frustration as the Dodgers led 4-0.

The Dodgers made Weaver work. He needed 72 pitches to get through three innings. The right-hander gave up four runs and five hits in four innings, struck out four and walked one.

"We didn’t help him out on defense, he didn’t help himself out," D-backs manager Torey Lovullo. "The long innings added to the equation of what I see is unacceptable defensive play."

Smith’s 24th homer in the sixth extended the lead to 6-1. Trea Turner’s RBI double in the first scored Muncy, who doubled. Turner hit his 22nd homer in the fifth.

After Arizona closed to 6-4 in the seventh, the Dodgers answered with two runs in the bottom of the inning. Muncy and Trea Turner drew consecutive walks by Brett de Geus. Seager singled and Justin Turner and Smith had sacrifice flies.

The D-backs closed to 6-4 in the seventh on a three-run shot by Marte, who went 3 for 4 with a strikeout.

Arizona trailed 5-1 in the sixth on David Peralta's RBI double off David Price. Pitching for the first time since Sept. 5, the former AL Cy Young Award winner gave up back-to-back singles to Josh Rojas and Marte that set up Peralta.

The Dodgers improved to 13-2 against Arizona this season, including 8-1 at home.

CLICK HERE TO GET THE FOX NEWS APP

TRAINER'S ROOM

D-backs: 1B Seth Beer left the game in the first with a dislocated left shoulder. He dived for Trea Turner's hit down the line and landed on his belly. Beer was making his first start as a position player in just his fifth major league game.

Dodgers: Closer Kenley Jansen came off the paternity list after missing two games for the birth of a daughter. He retired the side in the ninth in a non-save situation. ... RHP Mitch White was optioned.

UP NEXT

D-backs: LHP Madison Bumgarner (7-10, 4.66 ERA) starts the series finale.

Dodgers: LHP Julio Urías (17-3, 2.98) goes for his MLB-leading 18th victory. He is 2-0 with a 0.77 ERA against Arizona this season.