The witnesses said the family had evacuated the building, in the town of Khan Yunus, after they were told by telephone to flee minutes before the attack on Friday.
The Israeli army spokeswoman confirmed the military had telephoned them. She said the target was a warehouse used to store weapons. Israel has often accused Palestinians of hiding such facilities inside their homes.
Israeli troops killed two Palestinians in north Gaza earlier on Friday. The Israeli army said they were suspected of taking part in the firing of rockets into Israel.
The army said ground forces had fired at the pair as they were collecting a launcher that had been used several times in the past week to fire rockets into Israel. Palestinian witnesses said they were teenagers who were not involved in any attacks.
Israel has frequently targeted fighters in missile strikes in Gaza and has increased such attacks since it began an offensive in the territory soon after Palestinian fighters abducted an Israeli soldier in a cross-border raid in June.
About 220 Palestinians have been killed in the offensive, around half of them civilians, according to Palestinian medical workers and research groups.