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.
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.
Dennis Rodman pledges to end trips to North Korea
Scarlett Johansson steps out with fiance after pregnancy reveal