Laryea Kingston’s 90th minute tap-in secured a dramatic victory for Hearts over Inverness Caledonian Thistle.
Hearts took the lead in 39 minutes through David Obua’s header and Pavel Mihadjuks levelled after 56 minutes.
Roy McBain was dismissed for an off the ball incident after Michael Stewart missed a penalty, before Obua headed home his second in 79 minutes.
A Dougie Imrie free-kick two minutes from time restored parity, but Kingston sealed the win with a late effort.
First-team coach John Docherty took temporary charge of Caley Thistle following Craig Brewster’s sacking last week.
Russell Duncan fired in a tame shot after 10 minutes from 18 yards out on the right, but it lacked power and MacDonald gathered comfortably.
Five minutes later Stewart pounced on a loose ball inside the Caley Thistle penalty area only to fire a half-volley wide of the mark.
Driver sparked the match into life in the 20th minute when he struck for goal from wide on the left, but Esson dived low to collect.
As the half hour mark approached Don Cowie fired in a curling free-kick, but Imrie’s header flew inches wide of the far post.
Iain Vigurs delivered an angled shot from the edge of the Hearts box in the 36th minute, but Garry Wood deflected it past MacDonald’s left-hand post.
Obua opened the scoring for Hearts six minutes from half-time when Driver crossed in from the left and the Ugandan defender headed the ball past Esson, although McBain appeared to tap the ball into his own net as it crossed the line.
Immediately following the re-start, Wood fired in an effort from outside the Hearts box, but sent the ball wide.
Caley Thistle managed levelled in the 56th minute when Cowie sent in a free-kick from wide on the left and Mihadjuks sent a header past MacDonald.
Moments later, Ross Tokley blasted a sterling opportunity over the bar from just eight yards out.
In the 68th minute, McBain brought down Driver on the right-hand side of the Caley penalty area and referee Steve Conroy pointed to the spot.
Stewart took the kick, but Esson dived to his right and parried wide to keep the scores level.
Moments later, McBain’s afternoon deteriorated further when the referee dismissed the former Ross County man following an off-the-ball incident.
Obua netted his second of the match 11 minutes from the end, after Driver broke free down the right-hand side and crossed for the Ugandan defender to head in at the back post.
Hearts’ lead was short-lived after Imrie equalised for Caley in the 88th minute with a powerful 25-yard free-kick after Obua felled the former Clyde man outside the penalty area.
Less than a minute later, substitute Kingston sealed the points for Hearts after Driver powered down the right-hand side and cut back for the Ghanian international to tap in from close range.
Hearts manager Csaba Lazslo: “It was not a game for people with problems with their heart or blood pressure, but it for me it was an important three points.
“I told the players all week, this is the most dangerous team, if their coach is sacked, maybe the players would do their best to impress a new coach.
“Inverness played very good tactics to make us slippery and gift plays and possibilities, but the most important thing was the spirit from Hearts at the moment.
“It is not easy to come back three times, and the bench gave us something extra, not only from Laryea Kingston.”
Inverness Caledonian caretaker manager John Docherty: “It was certainly exciting, and got the heart going.
“Obviously, for a neutral, it was a great game, but unfortunately for us, it wasn’t.
“We played so well, and once again, we got nothing out of the game for the effort we put in.
“We said to the players to make sure we get the ball back and see out the last couple of minutes, but it was a bad goal to lose and they know it, they’re disappointed with it.
“I thought the lads’ effort was unbelievable, their commitment and the way they played football, but when you lose a man against a team like Hearts it’s always going to be an uphill battle.”
Hearts: MacDonald, Neilson, Jonsson, Berra, Lee Wallace, Driver, Stewart, Karipidis, Obua, Aguiar (Glen 64), Nade (Kingston 86). Subs Not Used: Kello, Mrowiec, Cesnauskis, Thomson, McGowan.
Goals: Obua 39, 79, Lee Wallace 90.
Inverness CT: Esson, Gathuessi (Proctor 18), Munro, Mihadjuks, Tokely, McBain, Duncan, Cowie, Imrie, Wood (Rooney 86), Vigurs (McGuire 76). Subs Not Used: Fraser, Black, Barrowman, Gillespie.
Sent Off: McBain (72).
Booked: Tokely, McBain, Imrie, Wood.
Goals: Mihadjuks 56, Imrie 88.
Ref: S Conroy