The Nigerian news station Channels TV reported that a primary school was located on the top floor of the building, "with pupils feared killed and others trapped".
Building collapses are frequent in Nigeria.
Rescuers at the scene of the collapsed school.
"The Ministry urges all Lagosians to report distressed buildings, illegal and non-conforming developments to the Lagos State Building Control Agency (LASBCA), Lagos State Physical Planning Permit Authority (LASPPPA) and Lagos State Materials Testing Laboratory (LSMTL) through our Helplines on our handbills", he said.
People and rescue teams search through the debris of the collapsed building on Thursday.
The school moved to the collapsed building some years back.
The list of survivors, obtained on Wednesday evening, shows 41 names, five of whom are unnamed. Some witnesses estimated as many as 100 children. As the sight drew uncontrollable tears from sympathisers, mostly women, the two corpses were quickly put into an ambulance and taken to the Lagos Island General Hospital mortuary.
A worker at the Massey Children Hospital, who spoke with NAN on condition of anonymity, said four out of those brought in died few minutes after. "That's why people stay in a building like that", she said.
It is not yet known what caused the collapse of the building, which stood in a crowded neighbourhood at the heart of Nigeria's commercial capital.
"Also many of these buildings are not well constructed".
He also called on architects, building engineers, bricklayers and the end-users to live up to the expectations by complying with the construction rules and regulations guiding the industry. I don't know why they refused to obey government's order.
Infiniti will exit western Europe early next year
Some 250 people work on production of Infiniti models in Sunderland, out of a total of around 7,000. Last year, Nissan's deliveries of Infiniti vehicles plunged 34 percent to just 10,958 units.
"It will be wicked of us to wait until calamity happens before government, institutions, professionals or individuals, can start to look for preventions".
Children are among those trapped after a building collapsed in Lagos, Nigeria's emergency agency says.
"If after the collapsed building had been found to be weak and marked for demolition, everybody had done what was required of them, perhaps this awful incident would have been averted".
"I'm surprised that the house and a couple of others which had been marked for demolition were left standing".
"On its part, the government must fast-track demolition arrangements once a building is discovered to be weak and deserving of being pulled down to save lives", he said.
While visiting the scene of the incident, the governor said the school and shops in the three-storey building, were not authorized and were operating "illegally" in the building, which is meant exclusively for residential purposes.
The building, which was described by residents and rescue workers, as "very old" and "marked for demolition since last year", came crashing after giving signs of fatigue.
It also housed shops, offices and residential units.
Lagos State Governor Akinwunmi Ambode, who visited the scene at about 2.30pm, ordered a full-scale investigation into the tragedy.
"We were in the market when suddenly we heard a loud boom", said Yemisi Bankole, deputy head of Itafaaji market.Concerned neighbours rushed to the scene as soon as the building fell and began rescue operations.
Prominent Lagos builder and surveyor Alani Fasiu Amusa said the "unscrupulous activities" of some developers and property owners were to blame.