She was also denied contact with her daughter who is now three.
Dowries have been illegal in India since 1961 but the practice is still widespread. Thousands of women a year are killed in dowry-related disputes.
Paying and accepting dowry is a centuries-old South Asian tradition where the bride's parents gift cash, clothes and jewellery to the groom's family.
Campaigners say the practice leaves women vulnerable to domestic violence and death.
Gunja Devi was allegedly detained by her in-laws in Darbhanga district in the eastern state of Bihar, police said.
She was rescued after her father Shyam Sundar Singh complained to the police that he had not been allowed to meet his daughter for the past three years. She has now been handed over to her father, police said.
It is unclear why it took so long for the alarm to be raised and for her to be rescued.
Gunja Devi was married in 2010 and her family has alleged that her torture escalated when she gave birth to a girl, in a culture where boys are valued.
According to reports in the local media, the rescue operation took place more than a week ago and photos at the time showed Gunja Devi appearing bedraggled from captivity - dressed in tattered clothes with unkempt hair and overgrown nails.
Her plight emerged in India's national media only on Monday with reports that she had been confined in a dark and dingy bathroom and was given very little to eat.
Police official Seema Kumari, who carried out the rescue operation, did not confirm whether Gunja Devi had been locked in a bathroom.
"She immediately asked for her three-year-old daughter and wept inconsolably when the child could not recognise her," the Press Trust of India quoted the police official as saying.
A police complaint has been lodged against Gunja Devi's husband and her in-laws. They were taken into custody, but later freed on bail, reports said.
They have not yet commented on the allegations against them.