Wow...That's weird that it's illegal in NY. A lot of people do that here in Germany, especially in towns that are near Universities and it's usually older people or widdows who have rooms left over in their homes.
After a quick google search, I don't think that it's illegal - especially since there are many listings for people who are renting out single rooms in their homes.
It would probably be best for you to go to your local courthouse just to make sure that it's legal and to find out what you need to do.