District Judge S C Khalipe also imposed a fine of Rs 5,000 each on the duo - Vikas Ambadas Avhad (21) and Vishal Gopichand Tilore (20), residents of Kalwa here.
According to the prosecution, the two raped a 24-year- woman in her house on the night of May 23 last year. The woman, a housewife and mother of two, was their neighbour.
Avhad and Tilore entered the woman's house after midnight and attacked her with a knife. The survivor was in the house along with her kids, it said.
The survivor later filed a police complaint after which the accused were arrested and booked for rape, it said.
The judge said the District Legal Services Authority should pay adequate compensation to the victim.