If you have already confirmed with the Department of Buildings and certificate of occupancy that yours is an illegal apartment, that's not an issue we need to further address. Please note, however, that according to the New York Courts website, Kings County will allow a landlord to collect rent for an illegal unit if the tenant knew that the unit was illegal at the time the tenant rented the apartment; also, they may allow for the correction of the situation by a landlord, through obtaining a proper certificate of occupancy (if possible for the building) and making the necessary physical changes to the structure.
If you move without notice and end up being sued, be sure that you have very good documentation of the facts that you intend to rely upon when arguing that the unit was unlawful. Take pictures and video, take the documentation you obtained from the Department of Buildings, bring independent witnesses who can describe the living situation, etc.

