Allan McGregor saved a Ryan Christie penalty before Ryan Kent fired Steven Gerrard's men in front after 36 minutes. Callum McGregor's shot went in off Odsonne Edouard for the equaliser before half-time but Nikola Katic headed the winner in 56 minutes. Rangers had Alfredo Morelos sent off in stoppage time for a second booking.
In the later games, Livingston leapfrogged Hibernian to go fifth in the table with a 2-0 win at the Tony Macaroni Arena while Hamilton Accies came from behind to beat Motherwell 2-1 in the Lanarkshire derby at Fir Park. That result means Hearts are now five points adrift at the bottom following a 1-1 draw with Aberdeen at Tynecastle.
St Mirren earned an important 1-0 home victory over Kilmarnock and it finished 1-1 between St Johnstone and Ross County at McDiarmid Park.