It happened just before 2:30 p.m. inside a home on the 3800 block of I Street in the city's Juniata Park neighborhood.
Police say at the scene, officers found the young girl suffering from a gunshot wound to the face.
She was transported to St. Christopher's Hospital for Children, where she was pronounced dead.
Investigators say two adults and two other children were inside the home when the shooting happened.
Police believe the victim and a 2-year-old were in the room together with the unattended gun. The adults were reportedly not in the room when the gun went off.
It is unclear whether the 2-year-old or 7-year-old pulled the trigger.
According to police, the child's family is being questioned by homicide detectives.
Authorities say two adults are in custody and charges are pending.
Sources told Action News that officers are investigating the incident as an "accidental shooting."
A gun was recovered at the scene, investigators say. The weapon is believed to be owned by someone in the house.
Authorities did not release any further information on the incident.