The men faced paying a fine of $285 or spending three years in prison after they were arrested last month in a security force crackdown following the raising of a rainbow flag at a music concert.
They were charged with practicing homosexuality and inciting debauchery.
The Sunday ruling according the judicial sources allows the defendants to appeal the sentence in a higher court.
The Egyptian society in majority does not put up with homosexuality, which is seen as a societal deviation.
Majority of the country’s close-to 100-million is Muslim and disapproves behaviors prohibited by Islam.