The men — all aged 18 or 19 — were arrested Wednesday, Spanish police said, after a medical centre visited by the 20-year-old woman alerted authorities in the early hours of the morning.
Three of the teenagers were remanded in custody Thursday, while two were released without posting bail.
These five “are indicted in an open investigation for crimes of sexual abuse,” judicial authorities said in a statement late on Thursday.
It added that the charges could be reviewed at a later date based on the results of the investigation.
Police said the men were initially arrested for alleged “sexual assault”, which comprises rape under Spanish law, and for the less serious charge of “sexual abuse” against the woman's friend.
The woman told investigators she and a friend — who is also Norwegian — had joined the men at the apartment in the seaside resort after meeting them on social media.
She said her friend later left the apartment and she was left alone with the five men, whom she accused of raping her.
Both Norwegians were able to help identify the men, who are all from the southern French city of Toulouse, using their social network profiles.
A lawyer for one of the accused, Frederic David, told AFP his client admitted having sex with the woman, but said it was consensual and was not in a group.
“The events took place in a very alcoholic context on both sides,” the lawyer said.
Spain's criminal code states that intimidation or violence must be proven in order for a person to be convicted of “sexual assault”, but the government wants to reform it to stipulate that a woman must give her explicit consent for sex.
In a notorious case, five Spaniards were first sentenced last year to nine years in prison for “sexual abuse” for the gang rape of a young woman in Pamplona in July 2016 during the city's famed bull-running festival.
But last June, the Supreme Court increased their sentences to 15 years each by requalifying the charges as rape.