LOS ANGELES — Matt Kemp yanked the Dodgers from the depths of despair with one swing.

Kemp hit a go-ahead home run leading off the eighth inning, lifting Los Angeles to a 3-2 win over the St. Louis Cardinals on Saturday night and evening their NL Division Series at a game apiece.

Kemp practically skipped down the first base line, appearing to coax the ball fair as it sailed inside the foul pole and landed in the lower left field seats while the crowd of 54,599 erupted in cheers. Bubbles percolated into the hot night air from a machine in the dugout that the Dodgers turn on to celebrate homers.

No one looked happier greeting Kemp in the dugout than a once-distraught J.P. Howell, who had served up a tying, two-run homer to Matt Carpenter in the top of the inning after relieving Zack Greinke. Kemp hugged Howell, who pointed skyward in relief, after connecting against Pat Neshek for his fifth hit in the best-of-five series.

Game 3 is Monday night in St. Louis, with John Lackey starting for the Cardinals against Hyun-Jin Ryu of the Dodgers.

Brandon League got his first career postseason win with a scoreless inning of relief. Kenley Jansen retired the side in the ninth to earn the save.

Greinke pitched two-hit ball over seven scoreless innings a night after ace Clayton Kershaw gave up Carpenter’s go-ahead three-run double in the seventh that helped the Cardinals win 10-9.

Greinke belatedly took the mound in the eighth after his teammates had already taken their positions. Manager Don Mattingly came out to get him, and Greinke left to a standing ovation.

Howell took over and promptly gave up a single to pinch-hitter Oscar Tavares before Carpenter tied it at 2.

Greinke struck out seven, walked two and didn’t allow a runner past second base. He didn’t give up a hit until the fifth, when Kolten Wong doubled down the right-field line before Greinke struck out the next two batters to end the inning.

Greinke was pretty nifty at the plate, too. He went 2 for 3 for his first career postseason multihit game, and even slid headfirst into third on Dee Gordon’s single in the fifth that eluded Wong’s dive at second base.

Cardinals starter Lance Lynn gave up two runs and seven hits in six innings, struck out eight and walked two.

The Dodgers took a 2-0 lead in the third. Gordon’s groundout to second base scored A.J. Ellis, who doubled leading off for his fifth hit of the series. Adrian Gonzalez’s two-out RBI single made it 2-0, with Greinke scoring from second.

Mattingly had earlier challenged a call that Greinke was tagged out going to second. After a review, the umpires ruled him safe when Wong tagged Greinke with his empty glove after Wong had already moved the ball to his throwing hand to try for a double play.

The teams that share a combustible history in the playoffs were under control, even after Greinke hit Cardinals center fielder Jon Jay with a pitch in the first inning. Unlike a night earlier, when Yasiel Puig’s plunking by Adam Wainwright triggered a benches-clearing scrum, everyone stayed put in their dugouts.

Puig, who drew attention with his neon-green batting gloves, struck out on a high fastball from Lynn in his first at-bat. Catcher Yadier Molina appeared to say something to Puig, who reacted and had to be walked part way back to the dugout by umpire Rob Drake. Puig struck out four times.

Molina and Gonzalez yelled in each other’s faces in Game 1 as both benches and bullpens emptied without punches being thrown.