The home nation will no doubt point to crucial decisions from referee Ashley Klein and video official Steve Ganson that went against their team, but after building a 10-0 lead they only have themselves to blame after a night when they made a series of uncharacteristic errors.
But the Kiwis had steadily improved through the tournament and put together a performance of skill, determination and power - and in doing so inflicted one of the greatest upsets in modern-day sport.
New Zealand started the match with aggression and energy, dominating the collision and enjoying territorial advantage.
Stephen Kearney's team should have translated their fine start into an early lead but Marshall - under no pressure - could not touch down Nathan Fien's beautifully weighted low kick.
And the underdog's failure to score was punished in the most emphatic manner when Billy Slater's curved run took him through a gap in the New Zealand defence.
The full-back, this week named world player of the year, burst forward before slipping an inside pass for Lockyer to score on his 50th international appearance.
'Wonderful' win delights Kiwi Kearney
Johnathan Thurston missed the conversion but made no mistake shortly afterwards from straight in front after the Kangaroos scored again. Slater's pass out wide caught Kiwi winger Manu Vatuvei out of position and sent David Williams flying down the wing before cutting inside.
Australia led 10-0 and the Kiwis were reeling. Had Lockyer not lost control as he touched down a grubber kick from Cameron Smith the final would surely have been rendered meaningless as a contest.
Buoyed by the let-off, the Kiwis forced two repeat sets and Jeremy Smith got them back into the match after 24 minutes with a try of great physicality, barging through several Kangaroo tacklers before touching down under the posts.
And the partisan home crowd were stunned minutes later when video referee Ganson awarded New Zealand another try after ruling that Anthony Laffranchi had raked the ball from Marshall before it came loose and bounced forward.
Sika Manu pounced and broke forward before passing for Jerome Ropati to score. Isaac Luke again added the extras and the Kangaroos trailed for the first time in the tournament.
However, sloppy play from New Zealand invited pressure and a sensational phase of play from the Kangaroos, with the ball passing through a series of hands, culminated in Lockyer scoring his second try. Thurston converted and a scintillating half ended with Australia leading 16-12.
The Kiwis, helped by uncharacteristic handling errors from the Australians, regained the lead when Lockyer bought Lance Hohaia's dummy and the full-back barged over.
New Zealand had the bit between their teeth, an attitude perfectly illustrated when Kangaroos winger Williams was dragged several metres into touch by several Kiwis.
New Zealand defended with incredible enthusiasm
Their enthusiasm boiled over and Australia capitalised on a penalty to almost retake the lead. Israel Folau brilliantly collected a low pass but was held up by Hohaia - and within minutes New Zealand extended their advantage thanks to a catastrophic error from the otherwise imperious Slater.
The full-back collected a deep kick and, under pressure from Vatuvei close to the touchline, Slater threw the ball blindly towards his own try line and Marshall scooped it up to score unopposed.
Marshall missed with the conversion but nonetheless his team led 22-16.
Inglis scored in the corner after a brilliant looping pass from Lockyer before Ganson's moment of controversy. Monaghan undoubtedly took out Hohaia as he closed in on Fien's kick but Slater did appear to be in a position to challenge for the loose ball.
Marshall converted from in front of the posts while chants of "Kiwi, Kiwi" sounded from the stands.
Everybody expected an Australian charge but another loose ball near the Kangaroo try line was touched down by Blair to seal victory.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.