The trans-Tasman rivals traded two tries apiece in the first half before Australia inched away after the break, but centre Malakai Fekitoa burrowed his way through as the clock ticked into red.
Colin Slade nailed the match-winning conversion to ensure the All Blacks, who lie in store for the British & Irish Lions in 2017, head to Europe in fine fettle.
Skipper McCaw said: "They talk about having to play for the 80 minutes, and that's the way it was. Both teams certainly came here to play and played some pretty good rugby.
"I guess the momentum slowed a couple of times but the composure our boys showed towards the end and hang in there and get the points when we had to was great.
"You've got to give credit to the boys, these games are the ones where you have to hang in there, wait for the opportunity and when you get it, nail it.
"The Wallabies did that earlier in the game, we did it to get enough points."