Officials said 58 people had been rescued or made it to land by themselves after the accident around midnight near Port Klang.
"But 37 people are still missing and we have found two bodies," said Mohamad Hambali Yaakup, head of the Port Klang office of the Malaysian Maritime Enforcement Agency.
"We plucked some of the survivors from the sea and others were found on land."
The boat sank not far from shore, raising hopes that many of the missing had already made it to safety on their own, he added.
Officials believe 97 passengers were aboard the wooden boat, including some children.
Authorities said rescued passengers told them they were seeking to return home to Indonesia across the Malacca Strait - the busy shipping lane between Malaysia and Indonesia's Sumatra island - for the Muslim fasting month of Ramadan.
Officials had initially said the passengers were believed to be seeking to enter Malaysia.
"From interviews with those rescued, they said they were returning to Aceh (in northern Sumatra). They did not have any travel documents," said Mohamad Hambali.
"As in previous years, many Indonesian migrants will be leaving Malaysia ahead of Ramadan."
Around two million illegal immigrants - the vast majority of them from Indonesia - are estimated to be working in Malaysia.
Large numbers of them annually return home to Indonesia ahead of Ramadan, which begins around the end of June and will culminate in late July with Eid al-Fitr, Islam's biggest festival.
Both countries are Muslim-majority.
"We believe the boat was overcrowded and the sea was rough during the incident," Mohamad Hambali said.
Access to survivors was not immediately available as they had been taken into custody by police.
Authorities said five vessels and a helicopter were searching for survivors.
Relatively affluent Malaysia is a magnet for migrant workers from poorer neighbours such as Indonesia, Bangladesh and Myanmar.
Accidents, however, are frequent as thousands annually risk the sea journey in rickety boats to seek low-paying work - typically shunned by Malaysians - on plantations, construction sites and in factories.
Indonesians often add to the risk by choosing to cross the Malacca Strait in darkness to avoid detection.
Last August, a boat carrying more than 40 Indonesians heading home for Eid-al-Fitr sank off southern Malaysia.
Malaysian authorities called off a search several days later, with seven confirmed dead and 33 still missing. - AFP