Upon written notice from the building official, work on any building or structure or the electrical, gas, mechanical or plumbing system therein that is being done contrary to the provisions of the technical codes or in a dangerous or unsafe manner, shall immediately cease. Such notice shall be given to the owner of the property, or to his agent, or person performing the work and shall state the conditions under which the work may be resumed. Where, in the opinion of the building inspector, an emergency exists, the building inspector shall not be required to give a written notice prior to stopping the work, but written notice shall be given as hereinabove provided as soon as practicable after such emergency stoppage.