Kansas City let a 3-1 lead get away in the fifth when Nick Swisher hit a two-run homer but the Royals responded to win for the second time in eight games.
Brayan Pena had RBI singles in the first and fourth innings for the Royals.
Jamey Wright (3-5) picked up the win with two innings of scoreless relief. Joakim Soria worked the ninth for his 30th save.
Kansas City's go-ahead run came off Damaso Marte (1-3).
The Yankees, winners of 102 games and certain to have the best record in the majors this year, had a seven-game victory streak snapped.
Copyright 2009 by United Press International.