England were bowled out on the fourth ball of the last over as the hosts fought back from what had looked like a losing position for most of the match.
The visitors had restricted Australia to 217 for nine wickets with a tight bowling display, but themselves ended up all out for 212.
Skipper Michael Clarke praised Australia's spirited fightback.
"A magnificent performance by the boys, with the ball especially," he said.
"I thought our batting was disappointing today," Clarke admitted. "For us to win the game, we had to bowl England out."
The visitors contrived to turn another winning position into defeat.
"We should have got over the line there. We got ourselves into a good position," said captain Alistair Cook.
"Credit to Australia: in the end they held their nerve better than we did. Poor shots were played under pressure."
Cook flies home on Monday after a miserable tour which included a 5-0 Test whitewash.
"Australia have had a great summer against us and they have managed to win the critical times," he said.
"It has been a tough couple of months for us but, you know, we've got a lot of things we can work on."
