Their arrests in September were part of a series of highly publicised raids targeting suspected homosexuals in the conservative country.
A lower court convicted them in November of broadcasting images that "violated public decency".
The men were detained after a video, filmed aboard a Nile riverboat, showed what prosecutors said was a gay wedding ceremony, with two men kissing, exchanging rings and cutting a cake with their picture on it.
The defendants' families, who were expecting their acquittal, screamed and wept on hearing the new sentences, according to an AFP reporter.
Also Read
"They took away my heart," said the mother of one of the defendants as she slapped her face after the yesterday's verdict.
Another woman whose brother was among the defendants screamed that his "future is finished".
Defence lawyer Emad Sobhi told AFP that the ruling was "full of loopholes" and would be appealed.
Homosexuality is not specifically banned under Egyptian law and the men were initially accused of debauchery.
The defence repeatedly denied that the men were gay, and insisted that the lower court had caved in to popular pressure.
One of the defendants told a television talk show prior to their arrest that the video was recorded during a birthday party.
In the past, Egyptian homosexuals have been jailed on charges ranging from "scorning religion" to "sexual practises contrary to Islam," the country's dominant religion.
In April, a court sentenced four men accused of homosexuality to up to eight years in prison.