Helicopters were scrambled as emergency crews eventually managed to halt the mammoth blaze after it tore through the 15-storey building in the city centre.
The health ministry said that at least two children were among those who perished in the fire.
Azerbaijan’s general prosecutor Zakir Garalov blamed the “low quality of plastic siding” on the building for the fire and said an investigation had been launched.
Baku has undergone an extensive facelift in the past few years as energy-rich ex-Soviet Azerbaijan has reaped the benefits of high oil and gas prices.
The city of some two million people has seen crumbling Communist-era blocks and early-20th century tenement buildings torn down to make way for glitzy skyscrapers.
The radical overhaul by the authorities has sparked protests from rights activists who accuse the government of strongman Ilham Aliyev of forcibly evicting residents without proper compensation. (AFP)