Emil Brown also drove in two runs for Kansas City, which had lost 11 straight games against Detroit this year. The win also snapped the Tigers' 10-game home winning streak.
"It's been a long four days here," Royals manager Buddy Bell said. "We won one, could have won three. But that's the way our season has gone."
"Collectively, we just weren't very good," Detroit manager Jim Leyland said. "That includes and starts with the manager and the coaches. We just weren't good today."
Elarton (4-9) yielded three runs and three hits to get his first win since June 22. He struck out two and walked three.
"Overall, it was decent," Elarton said. "But when you get nine runs, that makes it a lot easier."
He also downplayed the importance of beating Detroit.
"A win is a win and it doesn't matter who it was against," Elarton said.
Mike MacDougal pitched a perfect ninth for his first save of the season.
Zach Miner (6-2) allowed five runs and eight hits in 4 1/3 innings for Detroit. The loss stopped his six-game winning streak.
"They beat me. They hit the ball well, made me work a lot and had some good at-bats," Miner said.
Guillen's 12th homer gave Detroit a 1-0 lead in the second but Kansas City scored four in the third. Brown and Esteban German hit run-scoring singles and Gathright singled in two runs.
Gathright's two-run triple in the fifth made it 6-1.
The Tigers threatened in the bottom half when a walk and an error put runners on first and second with none out. But Chris Shelton, who was on second, tried to advance to third on Alexis Gomez's flyout to center and was thrown out by Gathright for a double play.
"I didn't think he was going to try," Gathright said. "I came up and saw him take off. Pretty simple."
Vance Wilson followed with a single, but Elarton got Curtis Granderson on a groundout to end the inning.
Brown doubled in a run in the sixth to make it 7-1.
Thames hit a two-run homer in the sixth and a three-run drive in the eighth. He has 19 homers this season.
"Their guys kept us off balance and pitched a good game against us," Thames said.
After Gathright was hit by a pitch from Wilfredo Ledezma in the seventh, he and Wilson, the Detroit catcher, had words and the dugouts briefly cleared. But order was quickly restored.
"I just turned around and said something to myself," Gathright said. "And he thought I said something to him."
- Kansas City beat the Tigers 4-3 on Sept. 21 in its previous victory over Detroit.
- Kansas City 1B Doug Mientkiewicz returned to the lineup after missing three games with a sore back.
- Guillen's homer in the second inning gave him home runs on consecutive pitches. He had a game-winning home run in Friday night's game and didn't play on Saturday. He hit the first pitch in the second inning on Sunday.
- Royals SS Tony Graffanino was 1-for-5 to stretch his hitting streak to 10 games (15-for-38), which matches his career high.
- Before the game a new postage stamp featuring Hall of Famer and all-time Tiger great Hank Greenberg was displayed. Greenberg played first base and left field for Detroit in 1930, 1933-41 and 1945-46. He then played for the Pittsburgh Pirates the following season before retiring. Greenberg hit 331 home runs and batted .313 for his career.