The court ruled out rape because the victim was in an "unconscious state" and the accused had not used violence or intimidation.
This is a requirement under Spanish law for a charge of sexual assault, which is legally the equivalent of rape.
Instead, they were convicted and jailed for the lesser crime of sexual abuse.
The five were sentenced to between 10 and 12 years in prison. A conviction for sexual assault would have carried prison sentences of between 15 and 20 years.
A review is currently taking place in Spain to decide whether to base rape cases on a woman's explicit consent to sex.
A number of European countries have changed their laws in recent years to define rape as sex without consent. Sweden changed the law last year and Denmark is doing the same.
The Barcelona verdict comes despite a ruling in a similar case by the Spanish Supreme Court upgrading a conviction from sexual abuse to sexual assault.
What reaction has there been?
Barcelona's Mayor Ada Colau denounced it as an "outrageous sentence" on Twitter.
"I am not a judge and I do not know how many years in prison they deserve, what I do know is that it is not abuse, it is rape!"
Warning: Some readers may find details of this story disturbing
Women's rights groups have similarly reacted to the ruling with anger and dismay. Furious social media users have been commenting on the case under hashtags like JusticiaPatriarcal (Patriarchal Justice) and NoEsAbusoEsViolacion (It's not abuse it's rape).
The case is known as the "Manada de Manresa" - Manresa Wolf Pack - for its similarities to a 2016 gang attack on a teenager which prompted widespread protests and an ongoing review of Spain's rape laws.
Lila Corominas, a spokeswoman for the Manresa Feminist Strike Committee, told newspaper Nius Diario this was "an obvious case of sexual assault and intimidation".
Leader of the Más País political party Íñigo Errejón said the sentence was "shameful", while Irene Montero, spokeswoman for Unidas Podemos, called for a change in the law "so we can speak proudly of living in a feminist country".
Some activists are calling for a protest against the court decision in Manresa on Saturday at 13:00 local time (12:00 GMT).
What happened in the case?
The five 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.
Prosecutors told the court the men - two Spaniards, two Cubans and one Argentine - 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.