The boy was identified as the son of slain Neo-JMB leader Tanvir Qaderi. The female militant was identified as JMB militant Sumon’s wife.
A few hours before the ‘self-execution’ by the militants, two women and two children surrendered to the police.
Home Minister Asaduzzaman Khan Kamal and Inspector General of Police AKM Shahidul Islam visited the spot after the operation was over around 3:45pm.
"Many grenades, live bombs and explosives are still lying there. Our bomb disposal units are working there now," Kamal told the media.
Police recovered the body of Sumon's wife later in the evening and sent to Dhaka Medical College for post-mortem examination.
The body of Tanvir's son will be recovered in the next morning, police said.
Earlier in the morning, the counterterrorism unit of Dhaka Metropolitan Police (DMP) cordoned off the three-storey building in the capital's East Ashkona area.
Using a loudspeaker, police asked the residents of the building to leave immediately and later called the militants to come out of the building and surrender.
A SWAT team was called in but the law enforcers decided not to storm the building as they had reports that the militants possessed a lot of explosives.
Police patience apparently paid off and at around 9am two women and two children came out and surrendered to the law enforcers.
They told police that three more of the group were still in the hideout and had threatened to blow themselves up with grenades tied to their bodies.
DMP chief Asaduzzaman Mia earlier in the day told journalists that the militants inside the building had a lot of explosives, which held police back from storming the building.
At around 1pm, a woman, accompanied by a child, came out of the building and detonated her improvised suicide vest.
Witnesses said they saw a woman's body lying in a pool of blood in the parking area of the building.
She was identified as the wife of the JMB militant 'Sumon' while the minor girl was the daughter of another militant 'Iqbal'.
"The woman in a burka came outside with a child and detonated the explosives tied to her waist," senior counterterrorism officer Sanowar Hossain told the media on the spot.
He was identified as the son of slain Neo-JMB leader Tanvir Qaderi. No policeman was injured in the raid.
According to police this was the second incident in Bangladesh, where militants have detonated suicide vests to avoid arrest.
In 2009, when RAB arrested most-wanted JMB explosives expert Jahidul Islam alias 'Boma Mizan' from Dhaka's Mirpur, his wife detonated a bomb in their house in an attempt to kill themselves.
But both survived miraculously and were arrested.
Mizan was later snatched away by his JMB comrades in a highway ambush on a prison van in Mymensingh while he was being been taken to court in 2014.
During Saturday’s operation at Ashkona in Dhaka's Dhakhshin Khan area, counterterrorism unit chief DIG Monirul Islam said they started the raid based on definite information that at least six Neo-JMB activists were hiding in the building.
“Police repeatedly urged them to surrender and four of them obliged,” he said.
His father Tanvir was found dead during the Sep 10 police raid at the Azimpur house. Forensic experts said he had committed suicide.
His twin brother was detained during the Azimpur raid and now is in police custody. Their mother Abedatul Fatema alias Khadija was also arrested from the house in Azimpur near the BGB Headquarters.
Wife faults slain husband Tanvir for joining militancy
Tanvir-Fatema changed after Hajj: Relatives
One of the four who surrendered to the police on Saturday has been identified as Jebunnahar, wife of slain Neo-JMB militant and former army officer Jahidul Islam. Police said a pistol and some munitions were found with them.
The three others were identified as Jahid's daughter, militant Musa's wife Trishna and her daughter.
Jahid, a former Bangladesh Army major, was gunned down in a raid on Sep 2 in Mirpur, Dhaka. Since then the police had been looking for his wife.
After the July 1 Gulshan cafe attack, police have raided several hideouts in Dhaka, Narayanganj and Gazipur, during which more than 20 suspected militants were killed.