O'Connor snuck over in the right-hand corner with 81 minutes on the clock in Hong Kong to bring the sides level at 24-24.
The 19-year-old then kept his composure to slot a stunning conversion to send the Wallabies wild.
New Zealand looked set for yet another Bledisloe Cup win having led 24-12 mid-way through the second half.
But a fine Drew Mitchell try set the scene for O'Connor's heroic efforts as the Wallabies made up for their narrow loss in Sydney last time out.
Robbie Deans' men started brightly at the Hong Kong Stadium, racing into a 12-0 lead thanks to tries from Quade Cooper and a fine individual effort from Adam Ashley-Cooper.
Both sides missed kicks at goal before the All Blacks hit back through tries from J immy Cowan and Corey Jane, plus two conversions and a penalty from Dan Carter, to lead 17-12 at the break.
A converted effort from Ma'a Nonu increased the advantage before Mitchell gave the Wallabies hope after great work from Kurtly Beale.
New Zealand looked to have secured the win when they turned over ball with 30 seconds left but replacement fly-half Stephen Donald failed to find touch and O'Connor supplied a scintillating finish with the final play of the game.