The court of Additional District and Sessions Judge Sandip Garg also imposed a fine of Rs 5000 on the convict, Sunil.
According to the prosecution, the woman had gone out to work while her seven-year-old daughter and niece of around the same age were at home in the Khairati village of the district on October 22, 2008.
Neighbour Sunil took her daughter to his house on some pretext and tried to rape her.
When the woman heard about the incident on her return, she went to Sunil's house to confront him. However, there, Sunil and his family members Ishwar, Mahabir and Kamlesh Devi allegedly misbehaved with her, prosecution added.
The woman had accused all the three of supporting Sunil in the crime.
However, they were acquitted by the court for lack of sufficient evidence against them.