Wonderful tries from Nehe Milner and Ma'a Nonu had given the All Blacks a 21-3 lead early in the second half before David Pocock and Tevita Kuridrani struck back.
With 15 minutes to go there were just four points in it, but a nerveless long-distance drop-goal and penalty from Dan Carter snatched back control.
Score Card:
New Zealand (16) 34
Tries: Milner-Skudder, Nonu, Barrett Cons: Carter 2 Pens: Carter 4 Drop-goal: Carter
Australia (3) 17
Tries: Pocock, Kuridrani Cons: Foley 2 Pen: Foley