New Zealand secured a remarkable final session victory by an innings and 65 runs as they dismissed the hosts for 122 in fading light.