Rayan fell down the narrow 32m deep well on Wednesday in his home village near Bab Berred in the rural Northern Province of Chefchaouen, local media said.
"The child's rescue is approaching," government spokesman Mustapha Baitas said on Friday. "Our hearts are with the family, and we are praying that he will back with them as soon as possible."
The shaft was too narrow for rescuers to reach the bottom, so heavy diggers were dispatched to dig a hole alongside it.
The MAP news agency said rescuers had been able to send him oxygen and water via pipes.
Rayan's father told Le360 news website he had been repairing the well when the boy fell into it.
Lead rescuer Abdelhabi Temrani told Al Oula television the diameter of the well was less than 45cm.
The drama has sparked an outpouring of sympathy online; the Arabic hashtag #SaveRayan has gone viral across North Africa, including in neighbouring Algeria.
Moroccan footballer and PSG star Achraf Hakimi mentioned the rescue efforts on social media, alongside emojis of a broken heart and hands together in prayer.
The boy's fate has also attracted crowds of people to the site of the operation, putting pressure on rescuers operating in "difficult conditions", Baitas said.
"We call on citizens to let the rescuers do their job and save this child," he said.
Authorities have also prepared a helicopter to take the child to hospital once he is extracted, national news channel 2M said.
- With news.com.au