Orders in 1995 to remove two upper floors had gone unimplemented.
The block is thought to have gone up in 1978 and was in the Loran district of Alexandria, a port on the north coast.
A police official said the building had seven original storeys, with five more built in recent years.
The local authorities had ordered the removal of the top two floors because they contravened building laws, but the order was not implemented, a source said.
Building collapses are frequent in Egypt. Many structures are unauthorised and have not been built according to regulations and with poor materials.
Two people were killed in May in a working class district of Cairo, the capital, when an old building collapsed as workers were restoring it.
In October 2006, seven people died when a four-storey building fell in the delta city of Mansoura.
A year earlier at least 16 people, including two children, were killed and 17 injured when a six-storey building collapsed in Alexandria. Three storeys had been added illegally to the building.