Additional District and Session court judge B K Tiwari also slapped a penalty of Rs 35,000 each on the two for the crime committed in March 2015 and ordered the sum be made available to the victim.
Failure to pay the penalty would attract at least six additional months in prison, the court ruled.
The judge also directed the state government to provide Rs one lakh to the victim in accordance with Protection of Children from Sexual Offences Act.