It's not unlawful to ask you anything - just like it isn't unlawful for them to ask to search your vehicle without probable cause.
The reality is you just have to say "no." But, if you have nothing to hide, this will generally make the situation much worse as the officer will make the reasonable presumption that you have something to hide (warrants, drugs, weapons, etc) and can generally always find some sort of "probable cause" to allow for lawful detaining. You aren't required to have identification (in most states, not sure if there are some that do) but you are required to give your real name and date of birth. If you lie, you're in some trouble.
What is funniest about this thread, though, is how everyone just instantly assumes that this story is even remotely true. It wouldn't blow my mind, really, because NYPD (and most departments along the east coast) is notoriously bad and corrupt but these kind of stories are usually bogus and horribly exaggerated and one sided. This story could have easily been posted as "50 year old couple dancing, police walk down and they immediately start swinging cane-knives at officers before being detained." Stop believing awful online news websites like this.