It IS legal to have chickens in NYC and there is even an organization that helps people get set up and understand what they are getting into called the City Chicken Project.
http://www.justfood.org/city-farms/city-chicken-project
This interview with Elizabeth Bee Ayer, who runs City Chicken Institute in Metro NY also stated that it is legal to have chickens but NOT roosters.
http://www.metro.us/newyork/lifestyle/home/2012/06/19/how-to-raise-chickens-in-new-york-city/
She also explains the level of commitment that it takes to raise chickens in NYC. Most importantly is this part of the article by MEREDITH ENGEL Published: June 19, 2012
How expensive is it to raise chickens here?
“It is a fairly costly venture. You have to buy the birds, you have to
build the coop, you have to buy a feeder and water. It’s so expensive
to raise chickens that most people lose money. You would have to sell
your eggs at, like, $15 a dozen if you’re gonna pay your labor costs.”