Brian Bannister (5-4) went six strong innings, giving up only one run on four hits and winning for the fifth time this month. Zack Greinke held the White Sox to one hit in the last 2 2-3 innings to earn the first save of his three-year major league career.
Jose Contreras (4-9) took his fifth loss in his last six decisions as the White Sox saw their season-best four-game win streak come to a halt.
The Royals, coming off their first three-game sweep of the Angels in Anaheim in 11 years, had not won five in a row since June 11-16, 2005.
The Royals were leading 3-1 when Joey Gathright singled with one out in the seventh and David DeJesus was hit by a pitch. Both moved up on Contreras' wild pitch, then German's single brought in one run. After Mark Teahen was intentionally walked, Costa lashed a two-run single into right.
Bannister, who won for the fifth time in six starts, went six innings plus one batter. He struck out five and had a season-high four walks. Tadahito Iguchi doubled leading off the second and eventually scored on Juan Uribe's infield out.