Rahul Sahu fell down the 80-foot (24 meters) well on the afternoon of June 10 while playing in the backyard of his house in the central state of Chhattisgarh.
Earth movers and cranes were used to help dig a tunnel next to the well, which is only a couple of feet wide. Army soldiers and members of India's disaster response agency helped in the operation.
Sahu "has been rescued safely because of everyone's prayers and untiring efforts of the rescue team," state chief minister Bhupesh Baghel said on Twitter.
Jeetendra Shukla, head of the local district administration, told journalists that the boy "was alive but weak" and was "rushed to a super speciality hospital" in the nearby district.
"A snake was seen in the same borewell but the boy has shown exemplary bravery and stayed calm during the operation," he added.
Bad weather -- and venomous snakes and scorpions unearthed by the dig -- hampered rescue efforts, local officials said.
During the rescue operation a camera was used to monitor the boy's condition and movements, Janjgir district police chief Vijay Agrawal told AFP by phone from the scene earlier Tuesday.
"Since the boy cannot speak or listen, we have a bigger challenge," he added.
An oxygen pipe fed Sahu fresh air, a government spokesman said. The tunnelling effort was slowed by hard stone underneath the ground.
Uncovered wells are a common feature of Indian farming villages and are frequently implicated in fatal accidents involving young children.
In 2019, a two-year-old was pulled out dead from a well after a four-day rescue effort in the northern state of Punjab.
The same year a one-and-a-half-year-old child was rescued in neighbouring Haryana state after being trapped for two days.