Cespedes connected with no outs off Josh Lindblom (2-1), sending a drive just inside the left-field foul pole. Oakland has won eight of nine after holding the NL's best team to eight total hits in the three-game series.
Starters Clayton Kershaw of the Dodgers and Travis Blackley each excelled. They both allowed one run on just three hits in eight innings. Blackley walked none and struck out six while the NL Cy Young winner fanned seven and walked two.
Coco Crisp drew a leadoff walk from Lindblom in the ninth and advanced on a wild pitch. Crisp moved to third on Jemile Weeks' infield single on which Lindblom fielded the ball and looked to third and then first but didn't make a throw.
Cespedes then hit his seventh home run of the season.
Ryan Cook (2-1) relieved Blackley in the ninth. Ninth-place batter Matt Treanor drew a walk, Dee Gordon bunted into a forceout and then the Dodgers speedster was caught stealing on an outstanding throw by new A's catcher Derek Norris.
The Dodgers were swept for just the second time this season. They dropped four in a row to Milwaukee at home in late May.
Brandon Inge had a sacrifice fly in the second as Oakland took an early lead, then Juan Rivera hit a tying RBI single in the fourth. That was all the Dodgers could muster for Kershaw, who is pitching with plantar fasciitis in his left foot.
Blackley retired the first 10 batters before Elian Herrera's one-out double in the fourth.
Blackley faced only one three-ball count all afternoon. The Australian left-hander made his fifth start since being claimed off waivers from the San Francisco Giants on May 15.
Norris was called up from Triple-A Sacramento before the game to share the catching duties with Kurt Suzuki. Norris came to the A's in the trade last December that sent All-Star lefty Gio Gonzalez to Washington.
Crisp's franchise record streak of 36 successful steals ended when he was thrown out at second in the first inning.
NOTES: A's manager Bob Melvin will continue to use Cespedes as designated hitter until he is fully healthy from a strained left hamstring and ready to return to his usual outfield spot. ... Mired in an 0-for-19 funk, Oakland's Josh Reddick had the day off. ... The A's will face two-time NL Cy Young Award winner Tim Lincecum (2-8) in Friday night's opener to the second interleague edition of the Bay Bridge Series. The Giants ace hasn't won since April 28 against San Diego, going 0-6 with a 6.44 ERA during his drought. ... RHP Chad Billingsley (4-5) pitches for the Dodgers in the Freeway Series at Anaheim on Friday night against Angels RHP Dan Haren (4-7).