The Navarra court confirmed nine-year prison sentences for the men - who called themselves "The Wolf Pack" and joked about the 2016 incident in a Whatsapp group - for the lesser crime of sexual assault.
The state prosecutor had originally asked for sentences of more than 20 years each for rape, which in Spain requires a plaintiff to present evidence of specific violence such as being threatened with a knife or dealt physical blows.
While the ruling agreed that the men had assaulted the woman in the doorway of a residential building, an incident that they recorded on their mobile phones, the lack of physical violence meant they would not be convicted of rape under Spanish law.
In July the government announced plans to change the Spanish penal code to make rape convictions easier.
"The sentence reinforces the need to make precise changes to the crimes of rape and sexual violence and to differentiate them those of abuse," Deputy Prime Minister Carmen Calvo said on Twitter on Wednesday.
The government had in July announced plans to change the Spanish penal code to make rape convictions easier.
The case attracted international attention in the wake of the global #MeToo movement that has highlighted sexual abuse and mistreatment of women.
It occurred during the annual San Fermin bull-running festival in the Navarran capital Pamplona, which is famed for its drunken revelry. But concern has grown over increased reports of sex attacks and harassment at the event, as well as over the mistreatment of women in general in Spain.
"(The ruling) is an embarrassment that shows that male chauvinism is well established in the courts and we must take measures, measures that must educate judges because woman can't continue to live in fear," the leader of the far-left Podemos party, Pablo Iglesias, said in an interview with state broadcaster TVE on Wednesday.
The original ruling was met by a wave of protests in Pamplona and other cities across Spain, where chants of "I believe you, sister" and "Drunk and alone, I want to get home" rang out across town squares.
Further protests were announced in cities across Spain following Wednesday's ruling.
The ruling, which can now be appealed in the Supreme Court, saw the men released on bail in June on a legal technicality that says no one can be held for more than two years without a definitive sentence being handed down.
All five men, who include a former policeman and a former soldier, paid 6,000 euros ($US6,800) in bail though their release led to further protests and concern across the political spectrum with pledges to revise the justice system's response to such charges.