Anesh and Yunish had allegedly raped the minor girl on Tuesday night.
While Yunish was caught by the locals and handed over to police, Anesh managed to flee.
The court of the 9th Additional District Judge Vivekananda Saran Tripathi sent Anesh to jail after he surrendered, an official said.
The duo had dragged the minor girl belonging to a different community from her house when her father was away and raped her.
The incident had sparked tension in the area and the Maghora Panchayat had decided to boycott socially and economically the Qureshi community to which the accused belonged, Maghora Pradhan Chandra Pal Singh said after a two-hour meeting attended by 700 villagers.