(g) This subdivision is applicable only to buildings noted, classified or recorded as such converted dwellings in the department prior to January first, nineteen hundred sixty-six. 5. Notwithstanding any provisions of this section or of subdivision five of section three hundred, an apartment or room in a cellar which was occupied for living purposes at any time on or after October first, nineteen hundred fifty-two may thereafter continue to be occupied for such purposes until July first, nineteen hundred sixty-seven in accordance with the conditions imposed by subdivision five of section two hundred sixteen.