Hearts recovered from the loss of a man and a penalty equaliser to defeat Aberdeen at a vibrant Tynecastle.
Jamie Walker gave the hosts the lead against the run of play on 18 minutes.
The Dons levelled from the spot through Niall McGinn after a professional foul on Calvin Zola had Kevin McHattie sent off.
But the 10-men struck again with three minutes to go through Jordan McGhee's back-post header following a long ball that Nicky Weaver missed.
Hearts have now reduced their 15-point penalty, for going into administration, to minus eight.
There was a minute's applause pre-match to mark the passing of former Hearts winger Jonny Hamilton and former Dons keeper Fred Martin.
And 2,500 visiting supporters made the trek south to ensure the stadium was packed.
Tynecastle has not been a happy hunting ground for Aberdeen who hadn't even scored here since January 2010.
The Dons had the first sight of goal in the third minute with Scott Vernon -making his first start of the season - beating the offside trap but scuffing his effort straight at home goalkeeper Jamie MacDonald.
Dylan McGowan and Mark Reynolds traded headers that went wide before the Jambos took the lead.
Walker took advantage of a standoffish defence before driving home from 20 yards into the bottom right corner, leaving Weaver helpless.
It was the second week running that the midfielder netted, after rescuing a point at Partick Thistle.
Vernon found himself through again a couple of minutes later, but with the Hearts defence sleeping the Mancunian put his effort wide.
McGinn, Peter Pawlett and two Clark Robertson headers all came and went as the hosts went in ahead at the break.
Dons manager Derek McInnes changed it early into the second half with Vernon hooked for Zola.
It paid dividends not long after as McHattie brought him down in the box - the left-back was sent off and McGinn converted the resultant penalty to make it three goals so far this season.
Pawlett was then booked for diving after a Walker challenge in the box, angering the travelling support.
McInnes went for the win, replacing Robertson with Gregg Wylde, but it was the 10-men who won it three minutes from time.
Weaver came and missed a long free-kick and 17-year-old substitute McGhee headed home his first senior goal.
McInnes and Hearts' assistant boss Billy Brown were sent to the stand in the aftermath before Josh Magennis's effort brought a great save from MacDonald.
Zola was denied a penalty in injury time, meaning the visitors' terrible record in Gorgie continued.
Sorry, we were unable to load match stats, please try again.