Western United have taken a big step towards securing a maiden A-League finals berth while knocking Western Sydney out of contention with a thrilling 5-3 win at Netstrata Jubilee Stadium.
United stretched out to a 3-0 lead through Josh Risdon, Besart Berisha and Alessandro Diamanti, before Western Sydney pegged it back to 3-3 through Mitch Duke's brace and Tass Mourdoukoutas.
But late goals to Max Burgess and Diamanti put down Western Sydney's late resistance and spared United's blushes.
In teeming rain in Kogarah, United seized control in the seventh minute when Max Burgess whipped a left-footed cross into the six-yard box where an inexplicably unmarked Risdon headed home.
In the 19th minute, Risdon helped double United's lead.
Berisha was involved in the build-up, working the ball to Diamanti who slipped a ball through for Risdon.
The full-back skidded a delightful ball past the Wanderers' defence and a surging Berisha dispatched his 15th goal of the season.
Early in the second half, United thought they had sealed the deal through Diamanti's spectacular 52nd-minute effort.
The Italian played a short corner to Connor Pain, received the ball back and lofted a left-footed chip over Wanderers goalkeeper Tristan Prendergast.
With the game appearing sealed, Duke kicked off Western Sydney's unlikely resurgence in the 69th minute.
Substitute Bruce Kamau cut down the right wing and looped a cross to unmarked captain Duke, who headed home his 13th goal of the season.
Then, Mourdoukoutas latched onto Pirmin Schwegler's free-kick with a delightful backheel to peg the deficit back to a goal in the 76th minute.
Six minutes later, Duke volleyed home to level the scores and seemingly put the Wanderers in the box seat for an unlikely comeback win.
But those hopes were extinguished a short time later when Burgess caught Mourdoukoutas dallying on the ball and restored United's lead in the 84th minute.
Three minutes later, Diamanti secured the points with a second classy chip.
The Wanderers had to win this game to stay in the race for finals football, but United had other plans.
They have now closed the gap to sixth-placed Adelaide to two points with three games remaining.
United's win was soured by the sight of veteran defender Andrew Durante leaving the field in the 51st minute with a potential injury concern.