Gordon Beckham's solo blast in the sixth forged a 6-6 tie, and then with and A.J. Pierzynski aboard two out in the seventh, Ramirez lined a 3-2 pitch from Boone Logan (4-2) into the left-field stands to put Chicago ahead for good.
Derek Jeter went 4-for-5 with a solo homer for the AL East-leading Yankees.
The New York shortstop's performance gave him a major-league best 167 hits for the season and 3,255 for his career, tying him with Eddie Murray for 11th on baseball's all-time list.
Attkisson leaves CBS News, reportedly over network's 'liberal bias'
McPhee, Cokas 'working on their marriage' after affair