Darren Mackie gave them an early lead only for Lee Wallace to equalise but the match ended in controversy after referee Steve Conroy awarded Hearts a penalty and then changed his mind.
Hearts manager Csaba Laszlo had an angry outburst at the fourth official as he went up the tunnel which is sure to land him in trouble.
Zander Diamond had the first chance of the game for Aberdeen when he met a corner from Sone Aluko but sent his header over the crossbar.
Hearts were caught out after 13 minutes when Marius Zaliukas failed to deal with a throughball and Mackie was alert to drill an eight-yard shot under Janos Balogh.
The swirling wind was making conditions difficult for both sets of players and neither team managed to get a firm grip on midfield.
Hearts equalised in the 21st minute after a surging run from Wallace. The full-back then played a one-two with Christian Nade on the edge of the area before rifling a left-foot shot high into the net.
The goal encouraged Hearts and they took the game to Aberdeen and the lively Bruno Aguiar flighted a shot just wide of the post with Jamie Langfield watching it all the way.
Nade was also causing Aberdeen some problems with his movement and touch and Christophe Berra was just inches away from connecting with an Aguiar cross at the back post.
Saulius Mikoliunas wasted a chance on the stroke of half-time when he hurried his shot after good work by Nade and sent it high and wide.
Hearts had a lucky escape early in the second half when goalkeeper Balogh let a simple catch slip through his hands from a hopeful ball by Scott Severin.
Then, Jared Hodgkiss cracked a wonderful shot off the underside of the crossbar with Balogh beaten.
But Hearts hit back immediately and Langfield did well to get his hand to a Berra header from Michael Stewart's free-kick.
Lee Miller was then denied by Balogh at the other end as both sides went all out for the winner. Miller came close again with a nice turn and shot after a decent pass from Aluko but his shot hit the outside of the post.
Referee Steven Conroy awarded Hearts a penalty with six minutes left after Stewart went down under Langfield's challenge but then changed his mind after consulting his assistant.