A judge in the central Egyptian province of Minya also sent a fourth defendant, aged 15, to a juvenile detention centre for an indefinite period.
Defence lawyer Maher Naguib said the four had not intended to insult Islam in the video, but merely to mock the beheadings carried out by jihadists of the Islamic State group.
The video was filmed on a mobile phone in January 2015 when the three teenagers who were sentenced to five years were aged between 15 and 17.
Their teacher who is also seen in the video has already been sentenced to three years in jail.
The four teenagers had not yet been arrested as of Thursday and Naguib said he planned to appeal the judgement.
"They have been sentenced for contempt of Islam and inciting sectarian strife," Naguib told AFP.
Signup to our newsletter and follow us on Facebook and Twitter!
"The judge didn't show any mercy. He handed down the maximum punishment."
In the video, one teenager can be seen kneeling on the ground and reciting Muslim prayers while others stand behind him, laughing.
The rights group Egyptian Commission for Rights and Freedoms said in a statement that it watched the video and found that the four children were performing scenes "imitating slaughter carried out by terrorist groups".
Egypt's constitution outlaws insults against the three monotheist religions recognised by the state -- Islam, Christianity and Judaism.
Copts, who comprise up to 10 percent of the country's 90-million population, are the Middle East's largest religious minority. They have long suffered sectarian violence including attacks on churches.
In 2014, a Coptic Christian teacher was jailed for six months after parents of her students accused her of evangelising and of insulting Islam.
In a separate case the same year, a Coptic man was sentenced to six years for insulting Islam, after posting a picture of Mohammed on his Facebook page with an insulting comment.
Thursday's judgement comes a month after female writer Fatima Naoot was jailed for three years for insulting Islam after she criticised the slaughter of animals during a major religious festival.
And in December, an Egyptian court jailed controversial Muslim scholar Islam al-Behairy for one year for remarks he made on his television programme, in which he called for reforms in "traditional Islamic discourse".