Quade Cooper and Dan Carter battled it out for kicking honours.
Cooper and Carter kicked two penalties and two conversions each but Australia edged it by virtue of scoring three tries to New Zealand's two.
Kurtley Beale, Will Genia and Radike Samo scored the tries for Australia with Ma'a Nonu and Conrad Smith touching down for the visitors.
The match was the final ever Tri Nations match, with the tournament expanding to include Argentina from 2012.
Australia took an early lead with a penalty, Cooper opening the scoring after three minutes when Kieran Read and Keven Mealamu dived in at a ruck.
Ashley Adam-Cooper was denied a try when the ball was stripped from him as he attempted to touch down after battling his way through tackles to fall across the line as the home side tried to press their advantage.
But Genia extended the lead, touching down when he picked up the ball at the base of a ruck in front of the posts and, instead of passing, going for a gap between two defenders. Cooper added the extras to put the Wallabies 10-0 ahead.
New Zealand got their first points on the board 20 minutes into the game when Carter kicked a penalty after the Wallabies were penalised for offside.
But when Nonu was penalised for tackling Pat McCabe without the ball, Cooper was able to restore his side's 10-point lead.
A minute later Samo added Australia's second try when he ran 50 metres to the line after dummying the All Blacks defence and handing off Adam Thomson before evading the attentions of Mils Muliaina and Cory Jane. Cooper again added the extras.
Australia held on to lead 20-3 at half-time, looking in total control after punishing New Zealand for mistakes in defence.
But New Zealand hit back with a Carter penalty early in the second half and then Smith put the seal on a fine move which saw the All Blacks go through 26 phases of play with a try.
Carter's conversion made it 20-13 and things got better for New Zealand when Nonu combined with Smith before touching down. Carter's conversion levelled the scores at 20-20.
But Beale had the final saw when he touched down with 20 minutes remaining to give Australia a 25-20 lead which they defended to the final whistle.
Cooper missed the conversion but the home side were able to hold out against concerted New Zealand pressure to win a thrilling match and end the final ever Tri-tournament on a high.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.