The men were convicted and jailed for the lesser crime of sexual abuse.
Under Spanish law, an offence can only be considered rape or sexual assault if physical force or intimidation is used.
The court ruled they had not committed rape because the victim was in an "unconscious state" and they did not need to use violence.
The decision comes despite Spain's Supreme Court reversing a similar ruling earlier this year.
There is also an ongoing review into the law.
Six defendants were initially charged. The five who were convicted were sentenced to between 10 and 12 years in prison.
A more serious conviction of sexual assault would have carried prison sentences of between 15 and 20 years.
Women's rights groups have reacted to the ruling with anger and dismay.
The men were found guilty of abusing the girl during a drinking session known in Spanish as a botellón at a disused factory in Manresa, a town in the north-eastern region of Catalonia, in October 2016.
The case became known as the "Manada de Manresa" - Manresa Wolf Pack - for its similarities to another 2016 gang attack on a teenager which prompted widespread protests and an ongoing review of Spain's rape laws.
What happened in this case?
Prosecutors told the court the men took turns to attack the girl, who was under the influence of alcohol and drugs.
One of the defendants, named only as Bryan Andrés M, was said to have told each of them: "It's your turn. Fifteen minutes each and no delay."
At a previous court hearing, the girl said she remembered very little of what happened but that one of the men had been brandishing a gun.
All the defendants denied the allegations, although the DNA of one of them was found on the girl's underwear.
The court ruled that the victim did "not know what she was and wasn't doing, and consequently, did not have the ability to agree to or oppose the sexual relations most of the defendants had with her", El Pais reported.
It added that the defendants "were able to commit sexual acts without using any type of violence or intimidation".
The court awarded the victim €12,000 (£10,300) damages for an attack it described as "extremely severe and especially denigrating".
What happened in original 'wolf pack' case?
A court in Navarra jailed five men for sexual abuse for a gang attack in Pamplona on an 18-year-old woman who was dragged into the hallway of a residential building.
As she appeared "passive or neutral", according to a police report, the court decided no intimidation or violence had taken place.
In June, the Spanish Supreme Court overturned that ruling, deciding it was sexual assault and that the men were rapists. The five saw their sentences of nine years increased to 15.
Spain's prime minister last year appointed a panel to review the rape laws.
More about: Spain