LOS ANGELES — The Cubs rallied for the tying and go-ahead runs in a five-run eighth inning, when the Los Angeles Dodgers committed three errors in a 6-3 loss to Chicago on Tuesday night that featured a matchup of Japanese star pitchers Yoshinobu Yamamoto and Shota Imanaga.

The NL West-leading Dodgers blew a 3-1 lead and lost to the Cubs for the second straight night, assuring their first series loss since Aug. 5-7 against visiting Philadelphia. Los Angeles’ division lead was cut to 4 1/2 games over second-place San Diego.

“We’ve played wonderful defense this series,” Cubs manager Craig Counsell said.

Chicago is four games back of Atlanta and the New York Mets, who are tied for the last NL wild card.

Center fielder Pete Crow-Armstrong robbed Max Muncy of a potential two-run homer with two outs in the ninth.

“Honestly, it feels like he has some like Velcro or something in his glove because he keeps making these great plays,” Cubs designated hitter Seiya Suzuki said through an interpreter.

Crow-Armstrong made a terrific sliding catch on the warning track of Kiké Hernández to end the seventh at the ballpark where he attended games as a youngster.

“I love it,” Crow-Armstrong said. “It feels better winning these last two and going home tomorrow with some good momentum.”

A leadoff walk by Alex Vesia, a throwing error by catcher Austin Barnes, center fielder Tommy Edman’s errant throw that went into the camera well near the Dodgers dugout and a fielding error by second baseman Hernández helped the Cubs take a 6-3 lead.

“It was a frustrating way to lose that game,” Muncy said. “We made a lot of mental mistakes. We got to eliminate that.”