“I think what I can safely say is that there were warning signs,” the mayor said on Wednesday. “They were clearly looked at by a variety of agencies. How that didn’t lead to a different outcome is what I don’t understand. And I find it an unacceptable outcome and I’m going to demand answers from everyone involved, and if we have to make changes as a result in our approach, we will.”

Ms. Perkins and Mr. Smith were arrested late on Tuesday and arraigned in Criminal Court in Manhattan on Wednesday evening on a charge of endangering the welfare of a child; both were ordered held on $50,000 bail.

Prosecutors said in court that they would file additional charges once the medical examiner determined how the boy had died.

In court, prosecutors said that Mr. Smith repeatedly beat Zymere with his hands, a broomstick and a baseball bat and that they lived in squalid conditions in their apartment with roaches, no electricity, rotting food in the refrigerator and walls covered in mold.

On Monday, prosecutors said, Mr. Smith beat the boy with a broomstick until he lost consciousness and collapsed on the floor. Mr. Smith took the boy to the bathroom and ran water over him, they said, before hanging him up by his T-shirt. Prosecutors said that when Mr. Smith left the apartment around 11:35 a.m., Ms. Perkins laid the boy on a bed and went to read the Bible. When he did not wake up, she took him to the hospital, and by the time he arrived in the emergency room at 2:25 p.m., they said, he had been dead for hours.