They had to come from behind after Kallum Higginbotham had given the home side the lead from the penalty spot.
A Nat Wedderburn own goal and a penalty of their own – duly dispatched by Grant Holt – before substitute Brian Graham added a late third, turned the match on its head and sent the three points to Easter Road.
It was enough to extend their lead at the top of the Ladbrokes Championship to three points, with Queen of the South losing 1-0 at Ayr United.
Elsewhere, Dundee United defeated Dumbarton by two goals to one, while Raith continued their incredible season under Gary Locke with a 4-2 victory at the Falkirk Stadium.
It means that four points separate the top five with Raith and Falkirk in joint-fourth on 17 points.
Full match reports to follow...