Cabrera had gotten on base ahead of Ramirez with a one-out single.
The Royals, who erased a 7-5 deficit in the 11th, mounted another comeback in the bottom of the 13th when Esteban German and Matt Aviles singled off Nick Masset on either side of David DeJesus's strikeout. But pinch-hitter Mark Grudzielanek grounded into a double play to end the game.
Nick Swisher and AJ Pierzynski each drove in two runs for Chicago. Jim Thome went 4-for-5 and scored three times. Joe Crede hit a solo home run and had two RBI. Paul Konerko came of the 15-day disabled list to contribute an RBI, as well.
Masset (1-0) got the win by throwing the final two innings. Starter Jose Contreras went 5 2/3 innings, giving up five runs.
DeJesus and Aviles both had two RBI for the Royals.
Royals starter Kyle Davies went 5 2/3 innings, surrendering three runs. Robinson Tejeda (0-1) was the loser, allowing a run over the final two innings.
The Royals had led 5-3 until Chicago tied it up in the eighth. The Sox jump ahead 7-5 in the 11th on a two-run sacrifice fly by Pierzynski but the Royals tied it again on an RBI single by Aviles and a run-scoring double by Gordon.