Four days before an infant overdosed on heroin this summer, a relative begged a judge to grant her temporary custody of the baby.

Her request was denied.

"The motion does not allege matters entitled to be heard on an emergency or expedited basis over other matters pending the court," read civil documents dated June 28 obtained by The Palm Beach Post.

On the evening of July 2, that baby, who was just shy of her first birthday, was rushed to St. Mary’s Medical Center in West Palm Beach after she "somehow ingested (heroin)," Palm Beach County Sheriff’s Office records state. The hospital’s staff revived her with two doses of Narcan.

RELATED: Read The Post’s complete coverage of the heroin epidemic

Last week, two adults, 38-year-old Charlie Hagan and 49-year-old Joseph Critelli, were arrested on child-neglect charges. Both Hagan and Critelli were released Thursday from the Palm Beach County Jail each on $3,000 surety bonds.

Civil documents list Hagan and Critelli as the little girl’s parents, although their relationship to her is redacted from criminal records.

The overdose

On the evening of July 2, the nearly 1-year-old was fussier than usual, Hagan and Critelli told authorities. The baby started to cry and made a raspy-type noise when Critelli put her down for a nap, he said.

Hagan walked over to the baby and realized something wasn’t right. Someone — it is unclear who — took the baby outside for fresh air. Someone started CPR, while someone else called 911.

MORE: Baby born during Hurricane Irma found dead in mom’s car

Critelli thought the baby may have gotten one of his cigarettes. He then speculated the baby was dehydrated because she was lethargic and her pupils "were smaller than normal, just not normal," Critelli told authorities.

Palm Beach County Fire Rescue crews rushed to the home in suburban West Palm Beach. The home was covered "from ground to ceiling with a multitude of items," sheriff’s authorities noted, adding that someone in the home is a hoarder. The exact address is redacted from arrest reports.

Critelli, who appeared to be under the influence of narcotics when speaking with authorities, said he was taking medication for an unspecified condition.

He told authorities he is a pharmacist, and Florida Department of Health records indicate he has a clear and active license, but list him as not practicing in Florida.

Critelli does not appear to have a criminal history in Palm Beach County beyond numerous traffic infractions. Hagan spent more than two years in state custody on burglary and drug-related charges. She was released from prison in January 2015.

Hagan told authorities she had overdosed and nearly died about a week before the baby ingested heroin.

Fighting for custody

Hagan overdosed June 26 in front of the child, a relative told a Palm Beach County judge June 28 in her petition for an emergency custody hearing.

"The mother of (the) child is addicted to drugs," the relative wrote. "Father has health issues and no suitable home for child."

The relative wrote that the baby had lived with her in suburban West Palm Beach since she was born. She asked that the court schedule an emergency hearing to approve her having temporary custody of the child "for the foreseeable future until parents have treatment and can provide stable environment and home for child.

"(The) parents are not fit at this time to care for the child," she wrote.

The court ruled that the relative’s request didn’t warrant an emergency hearing, so it was denied. Court records list Karen Miller as the judge in the case.

The relative didn’t return The Post’s call for comment as of Monday afternoon.

The Florida Department of Children and Families said Monday it had placed the child in the custody of an unspecified relative.