Despite playing with 10 men for the better part of an hour, the Heart snatched all three points thanks to a brilliant solo effort from their pacey winger.
Heart looked like their run of bad luck this season was set to continue when Dutch midfielder Orlando Engelaar earned a straight red card for a 33rd-minute studs-up challenge on Hagi Gligor.
And Heart's misery was compounded six minutes later when Corey Gameiro opened the scoring, slotting home after a shocking error from Melbourne goalkeeper Andrew Redmayne.
Fresh from a 5-0 demolition of Melbourne Victory last week, the Sky Blues looked set to put their opponents to the sword but Heart emerged from the half-time break a rejuvenated side as Jonatan Germano levelled proceedings in the 52nd minute.
The home side stepped up the attack but it appeared Sydney had weathered the storm and were set to earn a share of the spoils before David Williams – a 69th-minte substitute for Iain Ramsey – produced one of the goals of the season to give Heart the points.
Taking the ball in his own half, Williams used his pace to burst forward before cutting inside challenges from Matthew Jurman and Richard Garcia and calmly slotting the winner to send the a crowd of 7,674 people into raptures.
The result won't be good enough to take Heart off the bottom of the ladder but it certainly maintains the positive momentum around the club after its takeover by Manchester City last week.
For Sydney, though, the loss exposes the Sky Blues to challenges from below as Melbourne Victory, Adelaide and Perth all have the chance to leapfrog them into the top six over the weekend.
Despite their lowly position on the table, Heart controlled proceedings in the game's early stages.
With Engelaar and Harry Kewell pulling the strings in a five-man midfield, Heart dominated much of the first half hour, although they failed to make the most of several half chances.
Heart's best opportunity came in the 11th minute as Engelaar's header released Aziz Behich, who played a classy one-two with Harry Kewell before sweeping his effort wide of the upright with Sydney stopper Vedran Janjetovic beaten.
Although the Sky Blues were struggling to keep the ball, they created some chances of their own as Milos Dimitrijevic struck the bar in the 16th minute before Redmayne was forced to come off his line and deny a charging Gameiro three minutes later with a brave smother on the ball.
The match changed complexion entirely when Engelaar was given his marching orders for a studs-up challenge on Gligor that was more clumsy than malicious.
Sydney, though pressed home the advantage as they took the lead six minutes before the break when Ali Abbas' cross from the left took a deflection off Jason Hoffman.
Despite being in a good position, Redmayne fluffed his lines completely, dropping the ball and allowing it to bobble up for Gameiro to slam home.
However, there still appeared to be some heart beating for the Melbourne side as they almost earned a penalty during first-half injury time as Ramsey cut in from the right, only to be denied by Abbas' lunging challenge.
Yet Heart did take the momentum into the second period as they upped the attack once again, with Sydney skipper Alessandro Del Piero – an instrumental figure in most of his side's attacks – raising his hands to block a 48th-minute shot from Kewell in the box.
Del Piero may have got away with that one but he couldn't stop Heart from levelling four minutes later as Patrick Kisnorbo's header fell nicely for Germano in his first start for the season.
The Argentine utility hooked the ball over Janjetovic only to see Jurman do well to clear of the line.
But Jurman's clearance flew high in the box and when Janjetovic failed to grab it cleanly, Germano was on hand to slot the equaliser home.
However, Sydney looked set to earn the point before Williams took the game by the scruff of the neck in a thrilling finish for Heart fans.
Melbourne Heart 2 (Germano 52, Williams 89)
Sydney FC 1 (Gameiro 39)
Crowd: 7674 @ AAMI Park