New-look Roos denied in seven goal thriller
Cahill's brace made him Australia's outright leading goalscorer of all-time and Mile Jedinak added to the Socceroos' tally from the spot on his debut as skipper.
But a savage fightback from the South Americans in the second half punished the Roos with a four goal blitz and saw a red card for Mitch Langerak after a rash challenge in the box just minutes after he came off the bench.
The new-look Socceroos - wearing their latest retro-style kit - featured a whole new starting backline with Matthew Spiranovic pairing Curtis Good in central defence, flanked by Ivan Franjic and Jason Davidson, with Mat Ryan in goal, but displayed a calmness and maturity that belied the freshness of the formation and brought pace and mobility around the box.
Mark Milligan and Mile Jedinak partnered in midfield to screen the defence, with Tommy Oar and Mathew Leckie running the channels, with Oar especially flighting balls into the box for Cahill, backed up by Tom Rogic in the hole.
Australia started strongly, moving the ball quickly and worrying Ecuador with their pace in attack. Cahill enjoyed an early sight of goal in the sixth minute with a header that glanced just wide of the post.
Two minutes later he improved on that narrow miss. A driving run from Tom Rogic earned Australia a corner, which Tommy Oar swung in from the right. Mark Milligan, stationed on the edge of the area, headed the ball back into danger and Cahill was on hand to nod it home and enter the record books.
In the 16th minute Australia were awarded a penalty when Cahill went down after grappling with Gabriel Achilier inside the area. Jedinak stepped up to slot home the resulting spot kick with ease.
The Socceroos remained relatively untroubled by their opponents as the half progressed, and grabbed a third goal on 32 minutes. A quick break near the half-way line allowed Leckie to advance and swing in a cross, which Cahill dived to connect with and head past Adrian Bone in the Ecuador goal.
Mitch Langerak replaced Mat Ryan in goal for Australia at the break and the South American side made a host of changes, beginning the second half with considerably more purpose.
In the 57th minute their endeavour was rewarded with a goal from Fidel Martinez, who prodded the ball home after being found in a dangerous area by Enner Valencia's pass.
Less than 60 seconds later they had a second and Australia found themselves down to 10 men. Langerak rushed out to try and clear a ball into the area but Valencia got there first, and the Borussia Dortmund man was shown a straight red card after sending the Ecuador forward flying into the air.
The linesman initially raised his flag to signal Valencia was in an offside position but was overruled by referee Lee Probert, who spotted that the last touch came off Jedinak.
Brad Jones became the third player to pull on the gloves for the Socceroos in the game, but he was unable to prevent Segundo Castillo from making it 3-2 from the penalty spot.
The Ecuador onslaught continued as a series of substitutions from Postecoglou, including a debut for Alex Wilkinson, proved unable to stem the tide.
In the 78th minute a counter-attack saw Antonio Valencia advance into the area and cut the ball back for namesake Enner Valencia to guide past Jones.
With the clock ticking down it looked as if Australia would survive to claim a draw, but an error from Wilkinson, who was dispossessed in a dangerous area, allowed substitute Edison Mendez to claim an injury time winner for Ecuador.