Upon notice from the building official, work on any building or structure, or electrical, gas, mechanical or plumbing system, contrary to the provisions of the technical codes or done in a dangerous or unsafe manner, shall immediately cease. Written notice to stop work shall be given to the owner of the property, or to his or her agent, or to the person doing the work, and shall state the conditions under which work may be resumed. When an emergency exists, the building official shall not be required to give written notice to stop the work.