The victims were identified as Varshini Mandal (45) and Nomitha (40), they said adding another couple, also from Uttar Pradesh, sustained serious injuries in the mishap.
The labourers were working in Pannikkampalayam village for the past few months and staying in huts, police said.
The fire broke out at around 1.30 a.m. in one of the huts and spread quickly to the others, they said adding the reason for the blaze is being investigated.
Some of the workers managed to run to safety with their children, police added.
Police said another couple - Bharuthy (55) and Bulbull Mandey (50) - trapped in one of the huts was rescued and rushed to the government hospital in Erode with serious injuries.
Fire and Rescue Services personnel put out the blaze.