The shooting was reported just before 6 p.m. Saturday in the 1400 block of West Pacific Street.
The boy was home alone in the house with his 8-year-old sister, police say.
"Supposedly there was a gun inside a cabinet that the children located and, at some point, the child discharged the weapon into his own head," said Philadelphia Police Capt. Lee Strollo. "We're looking into how the gun got on location and who the owner of the gun is."
The 8-year-old sister ran to a neighbor's home to call for help.
Police said the gun should have never been out in the open to begin with, and the children shouldn't have been home alone.
Strollo said the gun was "freely accessible to the children." He said the gun should have been "in a locked box with only the adult owner having possession of that key."
Neighbors said they're heartbroken.
"When I hear a child... that's what brings tears to my eyes," said Willie Porter, from North Philadelphia.
"We as a society got to get it together, because our young children should not be having to go through this," said a man named Cornell.
Police Commissioner Danielle Outlaw issued a statement shortly after the shooting.
"Another one of our precious children has died as the result of gunfire," she said. "As a community, we must all strive to do better in keeping guns out of the hands of our kids."
There could be charges filed against the person who owns the gun.