The attack took place just before midnight on Sunday, when family members said the victim looked through a peephole on the side of the door.
The suspect fired two gunshots through the hole.
"The 29-year-old victim then looked through a peephole on the side of the door. When he was looking through this peephole at least two shots were fired," Philadelphia Police Chief Inspector Scott Small said in a statement.
The victim died at the scene as the gunman fled. Police have no suspects.