Danks (4-5) allowed only two hits and one run and struck out five in 7 1/3 inning for his first road win in more than six weeks. He entered the game 1-3 with a 6.83 ERA in five road starts this season.
More from ESPN.com
Watching the Dodgers' past two performances -- both losses -- left manager Don Mattingly practically speechless, Mark Saxon writes. Story
"We've done a lot of mechanical changes and a lot of work on the side in between starts," he said. "Just been trying to stay behind the ball and keep my lanes. I was falling off, and it was causing me to lose velocity and lose location, a bad combination.
"I've got to keep working on it, but I'm feeling good and I feel like I'm on a bit of a roll right now."
He also had an infield single in the sixth inning, his second hit in 28 career plate appearances.
"Even a blind squirrel finds a nut," he chuckled. "That's pure luck right there."
Dee Gordon led off the first with a bunt single, but Danks didn't allow another hit until the eighth, when Gordon doubled down the left-field line to end his night.
Danks threw 107 pitches and didn't allow a baserunner past second base. He walked three and hit two batters but worked around those miscues.
"I felt like I was able to make a pitch when I needed to," he said. "It wasn't as sharp as I'd like but I guess you can call it effectively wild."
A pair of long balls helped put him in position for the win.
Garcia was homerless in his first 74 career games but ended that drought in impressive fashion. The 23-year-old Dominican belted a first-pitch fastball from Josh Beckett deep over the center-field fence, an estimated 400 feet, to stake Chicago to a 1-0 lead.
"He has power; it's just more of his game is hitting on the ground," White Sox manager Robin Ventura said. "He hit it at the right time of day that's for sure. Ball carries earlier here; if it was later in the night, it may not have gone out."
Dunn followed Garcia the next inning, hitting a 2-2 cutter into the right-field stands for his ninth homer of the season.
Chicago closer Ronald Belisario slammed the door on his former team in the ninth, retiring the side in order for his fifth save and sending the Dodgers to their sixth loss in eight games.
"I really think you should talk to (the players); I'm tired of answering questions, honestly," Dodgers manager Don Mattingly said. "We're just not that good. We're just not getting it done."
Beckett (3-3) delivered a quality start but suffered his second consecutive loss since throwing a no-hitter against Philadelphia on May 25. The right-hander went six innings and allowed two runs and nine hits, walked two, and struck out six.
A moment of silence was held before the game for Don Zimmer, who died Wednesday at the age of 83. Zimmer played for the Dodgers from 1954 to 1959 and in 1963... Injured Dodgers outfielder Carl Crawford went through a full pregame workout that included batting practice. He is on the 15-day disabled list with a sprained left ankle and is eligible to be activated June 12. ... Beckett reached 2,000 career innings after completing the fourth inning. ... Ventura successfully challenged a call at third base in the bottom of the fourth, overturning an earlier safe call and ending the inning. Ventura is now 4-for-11 on challenges this season.
Copyright by STATS LLC and The Associated Press
LOS ANGELES, CA - JUNE 04: John Danks #50 of the Chicago White Sox pitches in the first inning against the Los...
45,540 (81.3% full) - % is based on regular season capacity
71 degrees, clear
Home Plate - Kerwin Danley, First Base - Lance Barksdale, Second Base - Mark Ripperger, Third Base - Gary Cederstrom
Yasiel Puig has hit .400 in at-bats that end in a pitch on the inner third of the plate or closer since the start of May, the seventh-best mark among qualified hitters. John Danks has thrown 41 percent of his pitches to righties in that zone, the seventh-highest mark among qualifiers.
Hanley Ramirez has posted a .943 slugging percentage since the start of 2012 in at-bats to end in a changeup from a lefty, tops among hitters to have at least 30 plate appearances end in the pitch; the next closest is slugging .765. John Danks has thrown the highest percentage of changeups among qualifiers this season (30.6 percent).