Sky Blues shock Wanderers in Sydney derby
Watched by a sell-out crowd of more than 40,000 fans at Allianz Stadium, the Sky Blues went behind to a Shinji Ono goal early in the second half before all the drama started.
Janjetovic produced a brilliant diving save to keep out Mark Bridge's tame spot-kick just two minutes later in a pivotal moment as Sydney staged their fightback.
Defender Matthew Jurman scored his first goal for the club to bring the side's level soon after before Richard Garcia grabbed the second 15 minutes from time after a calamitous mistake by Wanderers skipper Michael Beauchamp.
Ali Abbas added a third from the penalty spot in stoppage time as Sydney secured their first derby win in five attempts and first ever on their home turf.
The result pushes Sydney up to fourth spot on the A-League ladder and just three points behind their local rivals, who hopes of retaining their Premiers' Plate are now all but gone.
Given the occasion and what was at stake for both sides it was a tense first half which was sadly low on quality.
Neither goal-keeper was seriously overworked although Wanderers shot-stopper Ante Covic did produce and smart save early on to deny Ranko Despotovic.
The Wanderers slowly started to gain the ascendancy as the half wore on without really prising open the Sydney back four.
Their best chance came 11 minutes before the break when Youssouf Hersi found some rare space in the Sky Blues' half.
The pacy winger unleashed a dipping shot from 30-metres out which was headed for the top corner only for a spectacular diving save from Janjetovic.
While that was a brilliant stop there was nothing the Sydney 'keeper could do to keep out Ono just after the break.
The Sky Blues defence failed to deal with Bridge's cross from the left under pressure from Brendan Santalab, with the Japanese veteran on hand to volley home from close range.
Ono's strike brought the game to life and less than two minutes later the Wanderers should have doubled their lead, only for Janjetovic to deny Bridge from the spot after Garcia clumsily brought down Hersi.
That let-off seemed to inspire the home side and eight minutes later they were level.
Nikola Petkovic swung in a free-kick from the left which Covic failed to deal with, enabling Jurman to head home at the far post.
Tempers threatened to boil over soon after as after Wanderers hardman Iacopo La Rocca appeared to grab the throat of Abbas, with a number of players from both sides coming together.
But that wasn't the end of the drama as the Sky Blues grabbed the lead 15 minutes from the end.
There appeared no danger as Covic played a free-kick to Beauchamp just outside his own box, with the defender inexplicably playing a pass straight into the path of Garcia who had the simple task of passing into an empty net.
Abbas applied the finishing touches to a memorable come back for Sydney at the death, converting from the spot after Jerome Polenz was pinged for a handball.
Sydney FC 3 (Jurman 59, Garcia 75, Abbas 90+3)
Western Sydney Wanderers 1 (Ono 49)
Crowd: 40,285 @ Allianz Stadium