LOS ANGELES -

Things you don't figure to see on a baseball diamond these days:

First, St. Louis Cardinals pitcher Shelby Miller getting roughed up in the first inning for two runs.

Secondly, and perhaps more outrageously, Los Angeles Dodgers ace Clayton Kershaw giving the runs right back -- and then some -- the very next inning as the Cardinals touched him up for three runs to take the lead.

But that's exactly what happened on a sun-splashed Sunday at Dodger Stadium, the surprising early struggles of both star pitchers setting the stage for a 5-3 Cardinals' win at Chavez Ravine.

Matt Carpenter got the game-winning RBI, singling off the glove of Dodgers first baseman Adrian Gonzalez in the seventh inning to score Pete Kozma and saddle Kershaw with his third loss of the year.

Kozma went 4-for-4 with three RBIs.

"(Kershaw's) a great pitcher, but he's going to come out and throw strikes and you need to be ready to swing the bats," Kozma said.

Said Kershaw: "He hit two balls hard and blooped two balls. Sometimes that's what happens. Give him credit. He went up there looking for a fastball and he hit it."

Gonzalez, the Dodgers surging first baseman, got the scoring started in the first inning with a two-run home run off Miller to stake the Dodgers to a 2-0 lead.

With Kershaw on the mound that's typically a done deal these days, but the Cardinals barely blinked an eye before dropping three runs on him in the second inning.

Yadier Molina started the rally with a lead-off walk, then moved to third on a double by David Freese. A walk by Daniel Descalso loaded the bases for Kozma, who cleared the bases with a double to left field and the Cardinals led 3-2.

"The second inning was frustrating," Kershaw said. "The leadoff walk. The bloop hit was frustrating. You can't walk guys and I walked to that inning."

Miller and Kershaw settled down at that point, each tossing three scoreless innings.

But the Dodgers got to Miller again in the bottom of the fifth, a rally ignited by Kershaw when he beat out a ground ball to short.

Carl Crawford moved Kershaw to second on a single, and with two outs, Gonzalez lofted a fly ball that fell in front of Cardinals centerfielder Jon Jay, scoring Kershaw and tying the game 3-3.

The Dodgers had a chance to take the lead in the bottom of the sixth, loading the bases against Miller and relief pitcher Seth Maness, but with Kershaw up and one out, Maness got him to roll into an inning-ending double play to leave the game tied.

Getting out of that jam proved to be pivotal as the Cardinals took the lead the next inning when Carpenter singled off the glove of Gonzalez to score Kozma and put the Cardinals ahead 4-3.

The Dodgers again loaded the bases in the seventh, but hard-throwing Cardinals reliever Trevor Rosenthal got A.J. Ellis and Skip Schumaker to strike out to end the threat.

"The timely hits -- some of them weren't all that pretty but they came in today talking about fighting and that's exactly what they did," Cardinals manager Mike Matheny said. "When you face someone like Kershaw he's not going to give you anything. You have to scratch and claw for everything you get and that's what we did."

Miller came in with a 5-3 record and a 1.74 ERA. Kershaw, meantime, was 5-2 with a 1.35 ERA.

As a result, runs figured to be at a premium, and they were after the starters' initial struggles.

Miller left after 5 1/3 innings, giving up three earned runs on seven hits while striking out three.

"Our offense can put up runs and that's a great situation to do it after I gave up some runs," Miller said. "Just a great team win for everybody."

Kershaw went seven innings, allowing four runs on seven hits. He had five strikeouts and walked three on 104 pitches.

St. Louis added an insurance run in the ninth on a pinch-hit RBI single by Matt Adams.