The episode is the latest in a string of cases in which children have been killed during custody battles between parents. The Center for Judicial Excellence, an organization that tracks the safety of children in family court disputes, estimates that 679 have been killed by a divorcing or separated parent throughout the country since 2008, or about 60 each year.

Nearly a year ago, a 47-year-old mother killed her 7-year-old son by pushing him off the balcony of the Gotham Hotel in Midtown Manhattan before jumping herself. She had also been in a custody dispute.

The city Administration for Children’s Services had a file of past complaints concerning Zoey, but the reports appeared to be related to her parents’ custody battle, said an official familiar with the situation, who was not authorized to release the information. It is not uncommon for a parent in a custody dispute to accuse the other of abuse, the official said.

Mr. Rivera, the former work colleague, said Mr. Pereira had expressed fears that his daughter was being physically abused and exposed to marijuana smoke. He had told Mr. Rivera that Zoey’s mother had punched him in the face during one fight.

“I said, ‘Why didn’t you go straight to the police?’” Mr. Rivera recalled. “‘Maybe if you had, you could get custody of your daughter easier.’”

Zoey’s mother, Cherone Coleman, declined a request for an interview.

Mr. Pereira was arrested once before, six years ago, on charges of aggravated harassment involving a young woman, but the outcome of the case was sealed, the police said.

The episode that ended with Zoey’s death began shortly before 9 p.m. on Sunday, when the authorities responded to a 911 call for a car on fire near Baisley Pond Park in the Springfield Gardens neighborhood, the police said.