Ryan Kent gave Steven Gerrard's team the lead just after half-time but Steven Naismith equalised and Liam Boyce grabbed a late winner on his debut for Daniel Stendel's men, who closed the gap on second-bottom Hamilton Accies to a single point.
In the day's earlier game, St Mirren and Aberdeen played out a 0-0 draw in a match of few chances at the Simple Digital Arena.