LOS ANGELES -- Late Tuesday night after yet another dispiriting late-innings loss, Matt Kemp challenged his Dodgers teammates to "wake up" and recapture that winning feeling before the Giants ran off and hid in the National League West.

"We've got to learn how to finish games," Kemp had said as the midnight hour approached. "We haven't been good about finishing games, offensively and defensively. We're a veteran team. We've got to close out games. We've got to do that now.

"The Giants are playing real good baseball now. We've got to wake up -- now."

Here's a man who doesn't shy away from leading by example.

It took 12 innings of a draining Wednesday matinee, four hours and 25 minutes worth. But Kemp made his point with his legs and finally with his booming bat, lifting his team to a desperately needed 5-3 decision over the Phillies at Dodger Stadium.

It came with a familiar bang, Kemp launching a delivery by southpaw Jake Diekman into the pavilion in right-center for his 13th homer of the season and sixth career walk-off blast.

Perhaps the biggest win of the season for manager Don Mattingly's beleaguered troupe, it averted a Phillies sweep and sent the Dodgers off on a three-stop road trip feeling good about themselves.

Since June 15, when they were a season-high 17 games over .500, the Dodgers have scored five or more runs only four times, going 8-20 to surrender their division lead to the Giants.

"We're going to go on the road and get on fire, baby," Kemp said through a television microphone piped into the stadium, his adrenaline pumping moments after his first homer since April 30. "Don't give up on us, guys. We're going to finish strong and get in these playoffs."

Two innings before his second walk-off piece of the season, Kemp -- back after missing 51 games with a left hamstring strain -- had busted full-tilt to first to beat out a throw from the hole by shortstop Jimmy Rollins on what would have been a game-ending gem.

This infield hit delivered the tying run against Phillies closer Jonathan Papelbon, who was unable to preserve a two-run lead courtesy of Hunter Pence's two-run single in the top of an eventful 10th.

"I feel really, really good," Kemp said. "My legs are getting under me. ... We can't worry about what other teams are doing. We can only worry about ourselves.

"It's always good to take that confidence on the road against three tough teams [the Mets, Cardinals and Giants]. We've got to keep grinding it out."

More than an hour before Clayton Kershaw's first pitch, Kemp had blasted a Kanye West recording through the clubhouse speakers and bellowed his "wake up!" message for teammates.

Kershaw and Juan Rivera got the idea.

Kershaw worked eight superb innings, and Rivera unloaded a towering second-inning homer against Cliff Lee. But the offense then fell back into its mute mode under Lee's spell of brilliance.

After Lee, having yielded just three baserunners across eight dominant innings, departed, the Dodgers came to life.

They loaded the bases in the ninth against four Phillies relievers but couldn't push across the decisive run. Michael Schwimer, the last of the foursome, struck out James Loney to send it into extra innings.

Kershaw had matched Lee's effort, limiting the Phillies to a fourth-inning run. The amazing Carlos Ruiz singled home Shane Victorino, who'd singled and stolen second.

After the strangleholds of Lee and Kershaw ended, things got interesting -- and stayed that way until Kemp's authoritative exit strategy materialized.

Luis Cruz's first of two doubles got the tying rally started against Papelbon. In just his 12th game with the Dodgers, the versatile Cruz had never seen the former Boston closer -- live or even on video.

"No," Cruz said. "I don't like to think. I'm just trying to see the ball good. When you start thinking, it can get crazy.

"On this [2-4] homestand we didn't have a hit after hit [rally]. We started feeling good in that inning, and everything changed. A big thing for us was Matt beating that throw to tie the game. He really hustled down the line. If he doesn't do that, he doesn't get a chance to hit the home run."

Before the game, exploring ways his team could find its way out of its malaise, Mattingly had referred to Kemp's pointed words following Tuesday night's 3-2 defeat as "a good thing."

Mattingly, arguably the best player of his era for a five-year stretch with the Yankees in the 1980s, understands that the most compelling brand of leadership comes internally. He used Derek Jeter as a reference point during a conversation with his superstar center fielder.

"I talked to Matt early on," Mattingly recounted, "and said, `You know why the Yankees are so good? It's because their best player plays the hardest.'

"If Matt Kemp's saying we've gotta go, it's going to be by example more than talk. At the end of the day, it's a players' game. I can talk all I want, but if Matt Kemp is playing harder than anyone, it's more powerful -- because it's coming from a [teammate]. You want to have respect for the guys."

Kemp responded on Wednesday to the "MVP!" chants. A four-game losing spin ended, and a cross-country flight to New York for Friday night's start of a 10-game journey against the Mets would not feel like such a chore.

Everyone on board was wide awake now.