The child was admitted to the MKCG Medical College and Hospital, police said.
The incident took place two days ago, but it came to light yesterday when locals informed the police.
The girl's mother said she and her husband had left their daughter at their friend's house for the summer vacation so that she could play with his baby.
The accused was arrested yesterday.
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.