You would be obliged to let INZ know immediately, because, strictly speaking, your visa (and therefore, your permission to be in NZ) would come to an end along with the job. In practice, INZ are normally quite humane, and allow a person a period of time (weeks) to find another job. If they didn't find work in a reasonable time, INZ would tell them a date by which they must arrange to leave the country, and, as long as they complied with that, their record would stay clean - they wouldn't be classed as an overstayer (which would count against them for any future visa application).