Hearts came from behind to beat Rangers at Ibrox as the home side's players awaited news of their futures from the club's administrators.
Rangers captain Steven Davis broke the deadlock with a low shot on the stroke of half-time.
Ian Black's impressive shot levelled the match 13 minutes into the second half.
Jamie Hamill grabbed Hearts' winner with a rebound shot after having his penalty attempt saved.
And the defeat may prove to be the final appearance for several Rangers players, with an announcement on job cuts expected on Monday.
Motherwell's win at Dunfermline puts them just three points behind second-place Rangers in the Scottish Premier League while Hearts' victory moves them up to fifth.
The Edinburgh side threatened early on with Rangers goalkeeper Allan McGregor forced to deal with a Danny Grainger cross under pressure from Andy Webster before Andy Driver fired wide.
At the other end, Black cleared off the line after Sone Aluko's corner swung towards goal and Rangers debutant Rhys McCabe tested MacDonald with a long-range strike.
McCabe was a threat to the Hearts goal again, meeting Salim Kerkar's cross and forcing MacDonald to turn wide.
But MacDonald was beaten in first-half injury time, although he may feel he should have done better at the opening goal.
Andy Little's cross found Davis near the penalty spot and his low shot squirmed under the keeper.
Hearts introduced recent signing Craig Beattie for his debut at the start of the second half, the striker coming on for Darren Barr in a change of shape from the visitors.
Rangers came close to a second when Carlos Bocanegra's header from McCabe's free-kick slipped wide.
The visitors levelled when Robinson's header was cleared off the line by Bocanegra only for Black to retrieve on the edge of the box and curl a shot over McGregor into the net.
MacDonald touched Little's angled strike out for a corner, from which Dorin Goian headed over as Rangers tried to regain the lead.
Little ran on to McCabe's incisive through ball but MacDonald was brave as he saved at the forward's feet moments before Lee McCulloch's penalty appeal against Grainger's challenge was turned down.
But referee Crawford Allan did point to the spot at the other end after Goian held on to Marius Zaliukas in the box and the Romanian and his defensive team-mate Bocanegra were both booked in the aftermath of the decision.
Hamill's spot-kick was saved by McGregor but the full-back coverted the rebound with 11 minutes remaining.
Rangers pressed for a leveller but Hearts were dogged in defence as they held on for the three points and their first win at Ibrox since May 2004.