The Royals had a three-game winning streak snapped, managing just five hits in 6 2/3 innings against Andy Pettitte (1-1).
John Bale (0-2) took the loss, giving up four runs on eight hits in six innings.
Cabrera delivered a two-out, solo shot in the second to tie the game and the Yankees took the lead in the fourth when Posada scored from third on a double-play grounder.
Rodriguez and Posada hit back-to-back, two-out homers off Hideo Nomo in the ninth. Nomo made his first major league appearance in three years.
The game was delayed for 28 minutes by rain in the bottom of the third.
Swim Week Miami Beach 2014 [PHOTOS]