The Labour leader's Healthy Homes Guarantee Bill has passed its first reading in Parliament.
The Bill requires minimum standards to be set for heating, insulation, ventilation and drainage in rental homes.
The Government opposed Andrew Little's Bill but lost the vote when its allies, United Future and the Māori Party, got behind it.
It passed its first reading by 61 votes to 60.
"The principle is that no New Zealander should have to live in a house that makes them and their children sick," Mr Little said.
"The idea that we allow 42,000 Kiwi kids to go to hospital for avoidable infections is intolerable."
Mr Little said he was raising issues that concerned everyone.
"This matters to all of us, because we want to be part of strong communities where everyone gets a fair chance," he said.
"When young children live in houses that make them sick, they're denied that opportunity."
Labour, the Greens, NZ First, the Maori Party and United Future supported the Bill.
National and ACT opposed it.
The Bill has been sent to a select committee for public submissions.
A previous Labour Bill which would have done a similar thing was scuppered by National last year after a vote was tied at 60-60.
At the time, the Government called the Bill, which would have including inspecting every home, "extreme".
Newshub. / NZN