If the apt. Is illegal the courts will generally not allow continued occupancy. They also will not allow the LL to collect any further rent. When you get to court ask the judge you can speak to someone from Nassau-Suffolk law services. They usually have pro bono atty available to speak with and if you qualify they will also represent you. Good luck.
When responding to questions posted on Avvo, I provide a general purpose response based on NY law as I am licensed in NY. In reviewing my response, you are specifically advised that your use of, or reliance upon any response I provide is not advisable. I do not have all relevant background details or facts related to your issue / matter, thus I am not in a position to give you legal advice. Further, your review, use of, or reliance upon my response does not establish an attorney-client relationship between us nor does it qualify as a legal consultation for any purpose. For specific advice regarding your particular circumstances, you should consult and retain local counsel.