Two of the deceased were identified as Abdul Quader, 40, Rushdi, 4, son of Shahidul Islam, a resident of the building.
Ershad Hossain, duty officer of Fire Service and Civil Defense Control room, said the fire broke out at the garage, located on the ground floor of a five-story building, around 4:32am.
Eight firefighting units went to the spot and extinguished the fire around 5:30am.
Foysalur Rahman, senior station officer of Tejgaon Fire Station, said firefighters rescued 17 people. Three others were found dead.
Among those rescued, five people, including Rushdi’s parents Shahidul, 40 and Jannatul Ferdous, were sent to Dhaka Medical College Hospital.
Garments accessories are housed on the first and second floors while the garage is the only exit and entry point of the building.
The cause of the fire is still unclear.