A 5-year-old boy — left home alone inside a rat-infested Bronx apartment — was rescued Friday after he was discovered by a FedEx deliveryman, law enforcement sources said.

The boy’s parents, Wilfred Lewis, 59, and Charlotte Lewis, 48, were arrested and charged with endangering the welfare of a child after cops discovered the kid in the apartment filled with feces, trash, bedbugs and maggots, sources said.

The deliveryman needed a signature on a package and knocked on the family’s door, which the little boy answered, sources said.

The FedEx man asked where his parents were and the boy responded, “They’re not home,” before the deliveryman flagged down nearby cops for help, sources said.

The mom, a nurse at Montefiore Medical Center, was arrested at work, authorities said.

The father, who claimed his 5-year-old son was “self-sufficient,” surrendered at the 50th Precinct station house, sources said.

The boy’s siblings — two girls, 12 and 13, and a 15-year-old deaf boy — were in school at the time.

City child-welfare agents took the kids to Montefiore for evaluation.

The apartment reeked of human feces and a look inside the apartment — through the drilled-out door knob — showed trash strewn throughout the unit.

The family has had previous contacts with the Administration for Children’s Services, sources said.

Additional reporting by Nick Fugallo and David K. Li