© Getty Images
Melbourne were soon back in the contest, as Connor Pain set up Archie Thompson for a simple tap-in, before Marc Warren was sent off for a professional foul on Pain midway through a pulsating first half.
The visitors then levelled on 27 minutes when James Troisi found the net from 25 yards.
Despite their numerical disadvantage, Sydney regained their lead 10 minutes later.
After being pushed over by Pablo Contreras in the penalty area, Alessandro Del Piero, who was making his return following a calf injury, got up and placed an unstoppable spot kick into the bottom left corner of Nathan Coe's goal.
Sydney had lost their last three matches, but they produced a spirited performance in the second half to ensure that their slump came to an end.
Melbourne had plenty of possession, but a determined defensive display, including a superb last-ditch sliding tackle by Pedj Bojic to deny Andrew Nabbout in stoppage time, dragged Sydney over the line.