SAN FRANCISCO -- The deep, slugging Los Angeles Dodgers took a far more challenging road on their sixth straight trip to the playoffs. Despite it all, they still believe they're the team to beat for a World Series title.

A surprising 16-26 start and injuries to some of their biggest stars, including a pair of disabled list stints for ace pitcher Clayton Kershaw, left the Dodgers in a hole and needing to win in the final weekend to claim baseball's final postseason berth.

Kershaw and the Dodgers earned that spot and moved into a tie with Colorado for the NL West lead, getting a go-ahead triple from Manny Machado in the eighth inning Saturday and beating the San Francisco Giants 10-6.

And they celebrated, even with more to accomplish Sunday.

Colorado lost at home to Washington, dropping into a tie for the division lead. The regular season is scheduled to end Sunday -- if Los Angeles and Colorado finish even, there will be a one-game tiebreaker for the West title Monday at Dodger Stadium.

"It hasn't been easy, I guess, this year, we've kind of been in a dogfight the whole year as far as with the Diamondbacks and the Rockies," Kershaw said between dousings. "This game in particular just kind of showed the team that we have. It's never good when I'm a better hitter than I am a pitcher. That's what it was today. For these guys to pick me up like they did today -- I don't know, I think we had 18 hits or something -- it's just really special to be a part of. The celebration today is a little bit more subdued, and we want it that way."

The Dodgers, who haven't won the World Series since 1988 and lost in Game 7 to Houston last year, assured themselves at least a spot in the wild-card game. They joined Colorado, Atlanta, the Chicago Cubs and Milwaukee in the NL playoff field.

Once the champagne had been popped, sprayed in triumph and consumed, many of the Dodgers were headed back to their hotel to watch the Rockies.

"We went through a lot of ups and downs, but we've still got a chance to win the division," veteran Matt Kemp said. "I think everybody's going to sit there and watch the game tonight and see what happens and try to take care of business tomorrow."

After the final out, the Dodgers exited their dugout and high-fived in a tame celebration. Manager Dave Roberts waved to hundreds of fans in the outfield bleachers.

The Dodgers' win eliminated St. Louis from playoff contention. The Cardinals beat the Cubs earlier in the day to preserve their postseason chances for another few hours.

Machado, the star infielder acquired from Baltimore during the All-Star break, hit a two-out triple off Mark Melancon (1-4) for a 6-5 lead. Max Muncy added a two-run double during a four-run ninth, much to the delight of all the Dodger Blue in the rival's ballpark.

Alex Wood (9-7) pitched the seventh for the win and Kenley Jansen closed it out. Roberts said afterward it was a "no-brainer" with too much on the line to not go with his reliable ninth-inning man.

Kershaw allowed eight hits and five runs -- his most in 44 starts against the Giants -- over five innings and had a two-run single in the fourth for his first career RBI in 24 games at AT&T Park. The lefty made just 26 starts and failed to beat the Giants in four 2018 outings. He missed double-digit wins for the first time since going 8-8 in 2009, also the last season he didn't beat San Francisco at least once.

He said he has been too "preoccupied" with getting to the playoffs to consider his next step and future, saying, "I have no idea ... I can't give an answer because I really don't know what is ahead."

Joc Pederson gave the Dodgers a fast start with his 11th career leadoff home run, his franchise-record eighth this season. Yasiel Puig connected to start the second inning.

The Dodgers dropped into second place in the West behind the Rockies following a 7-2 loss at Arizona on Wednesday. That left Los Angeles the final weekend against its rival to capture a third playoff trip in as many years under Roberts.

He still believes these Dodgers -- with their talented rotation, bullpen and loaded lineup -- are in prime position to bring home a championship.

"I think we're the best team," Roberts said. "And I've said it. Most importantly though we've still got to go out there and play like it."

ROOKIE HIGHS AND LOWS

Giants rookie Dereck Rodriguez, who lasted just three innings while facing the Dodgers for the first time, saw his winless stretch reach seven starts since defeating the Pirates on Aug. 12. His 2.81 ERA with a minimum of 100 innings pitched ranks lowest in San Francisco history for rookies. The Giants lost his last seven outings and nine of 11.

"I'm sure he's disappointed that his last start went like this but he's done an unbelievable job," manager Bruce Bochy said.

TRAINER'S ROOM

Giants: OF Austin Slater won't play again this year because of a strained right elbow revealed by an MRI exam. He's expected to be full strength by spring training.

Umpire: Friday plate umpire Brian Knight broke his left foot on a foul tip in the top of the sixth inning -- he kept working -- then was replaced Saturday by Ed Hickox, who arrived in the Bay Area about 3 a.m. after working a 15-inning Diamondbacks-Padres game at San Diego.

UP NEXT

Dodgers: RHP Walker Buehler (7-5, 2.76 ERA) won in his first career start at AT&T Park on April 28. The Dodgers weren't ruling out a change based on the Rockies' outcome.

Giants: LHP Andrew Suarez (7-12, 4.22) has received three or fewer runs of support in 21 of his 28 outings.