A late Brendon Santalab strike gave Tony Popovic's side their first home win in a Sydney Derby and moved them to within four points of the table-topping Brisbane Roar.
A pulsating derby looked headed for a draw as neither side were able to make the most of their few clear-cut chances in front of more than 18,000 fans at a raucous Pirtek Stadium.
But just as it appeared the Sky Blues would keep their unbeaten record at Parramatta intact, Santalab had the final say.
Youssouf Hersi managed to skew a cross over from the right which found its way through to Santalab at the far post.
The former Sky Blues attacker controlled on his thigh, before poking the ball under Vedran Janjetovic and into the net.
While the visitors enjoyed the better of the second half, it was a deserved victory for the Wanderers for their first-half effort which saw them hit the woodwork on four occasions.
The result means Tony Popovic's side close the gap on league leaders Brisbane Roar to four points ahead of a clash with the Melbourne Victory on Tuesday night.
Sydney have now won just one of their last five games and have dropped out of the top six for the first time in two months.
The Wanderers had the better chances of an absorbing first half and started their string of finding the frame of the goal inside eight minutes.
Tomi Juric picked up a loose ball 25 metres out and was allowed to turn and drive a low shot which was fortunately tipped onto the post by Janjetovic.
The Sydney 'keeper had the woodwork to thank again 10 minutes before the break as Mark Bridge's effort across the face of goal skimmed the post on its way wide.
Then in a crazy end to the half the home side hit the crossbar twice in a matter of seconds.
First Hersi saw the ball bounce back off the crossbar after an audacious effort from 35 metres out had Janjetovic scrambling.
The rebound fell to Juric who took one touch to control on his chest before blasting another shot which cannoned off the bar.
The break offered some much-needed respite for the Sky Blues and they seemed to gain confidence from their lucky escapes.
Substitute Corey Gameiro, Terry McFlynn and Ranko Despotovic all went close to beating Ante Covic as the visitors dominated the first 20 minutes of the second half.
The match opened up in the closing stages as both sides tired and pushed for a winner, with Santalab popping up at the death to sink his former club.
Western Sydney Wanderers 1 (Santalab 86)
Sydney FC 0
Crowd: 18,080 @ Pirtek Stadium