The fire started at Mohakhali Sattola slum around 3:40am, said Kamrul Hassan, a duty officer of Fire Service and Civil Defence.
For all latest news, follow The Daily Star's Google News channel.
On information, 18 firefighting units rushed to the spot and brought the fire under control around 6:35am, he added.
The reason behind the fire could not be known immediately.
Minu Begum, a resident of the slum, said that she woke up hearing people screaming after the fire broke out.
She managed to make it out with her mentally unwell husband and two children. But she could not take any of their belongings from the room, she told The Daily Star.
Monu Mia, a cleaner of Dhaka North City Corporation, said when the fire spread in the slum, he was at Karwan Bazar on duty.
He heard about the incident and soon came to know that his home was burning. By the time he reached the slum, all his furniture and other belongings in the shanty were gutted, he said.
Monu toiled hard and saved Tk 70,000 for building a house at his ancestral village in Patuakhali but that dream won't be realised now, he told our staff correspondent.
Niyaz Ahmed, Deputy Assistant Director of Fire Service and Civil Defence, said, "Reason of the fire can't be ascertained right now. There are many reasons which might have caused the fire."
"There are illegal gas pipes in the slum and also, those are made of plastic, which might be one of the reasons. We gave our hundred percent effort to douse the fire," he added.