LOS ANGELES (AP) — Giancarlo Stanton is heating up, and carrying the Miami Marlins with him.

Stanton homered for the third straight game, hitting a go-ahead, three-run shot off Clayton Kershaw, and the Marlins rallied to beat the Los Angeles Dodgers 6-3 on Tuesday night for their third straight victory.

The Marlins trailed 3-0 before scoring five runs in the sixth inning off Kershaw (2-1), capped by Stanton’s drive into the center-field bleachers.

"I’m just trying to help us get up and stay up," Stanton said. "That’s what it’s about. Doing that at (the) right place, right time."

Stanton’s recent power surge followed a 5-for-36 slump with one home run in his previous 10 games.

The Marlins improved to 5-1 when Stanton homers, compared to 3-10 when he doesn’t.

"Giancarlo is a dangerous cat," Miami manager Don Mattingly said. "I think we’ve seen the last three days, when you’re getting power in the order with a guy like that, you put up runs quick."

Kershaw’s five earned runs allowed in the sixth inning were as many as he allowed in his first 35 innings to start this season. He hadn’t allowed five runs in an entire game in his last 30 starts.

Kershaw finished with 10 strikeouts in seven innings but got his first loss in his last eight regular-season starts dating to last year.

"That’s a tough one to let get away," Kershaw said. "We had a 3-0 lead and my job is to keep it and I didn’t do my job. I felt OK tonight, a little better than I have in the last few starts actually, but the results weren’t there."

Tom Koehler (2-2) pitched five innings for the win and A.J. Ramos worked around a two-out, two-on jam in the ninth to close it out for the Marlins.

The Dodgers jumped out to a 2-0 lead in the first after Koehler walked three of his first four batters and threw two wild pitches in the inning. Kershaw ripped an RBI double in the fourth to make it 3-0.

That appeared it would be enough for the Dodgers ace, who retired 12 in a row before the Marlins suddenly and unexpectedly rallied with one out in the sixth.

Miguel Rojas’ pinch-hit bloop double down the left-field line began a run of five straight Marlins batters recording a hit. Dee Gordon followed with an infield single that caromed off Kershaw, and Martin Prado and Christian Yelich hit back-to-back RBI singles to cut the Marlins’ deficit to 3-2.

Stanton stepped up to put them in front, blasting a 1-0 fastball high beyond the center-field fence to make it 5-3.

"He was dominating early so you get the sense of he’s going to take this game with him and call it a night," Stanton said. "Shows how quickly you can turn it around."

That was enough for the Marlins’ relievers, who held the Dodgers scoreless over the final four innings.

Craig Breslow pitched 1 2/3 innings, Ryan Barraclough struck out the side in the eighth and Ramos converted his fifth save in five chances to finish it.

Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

Join our Newsletter for the latest news right to your inbox