Local police were alerted to the crime early on Sunday morning after they found a young woman on the ground, crying, Spain's 20 minutos newspaper reported.
She told officers she had been leaving work at the fairground when the rape took place.
After describing her attackers, two of the men were arrested. They then confessed and gave up the other three young men involved.
Among the alleged rapists were two men aged under 18.
The victim of the attack has received medical attention while the suspects have been questioned by police.
One of the suspects is thought to have filmed the attack, local daily Diario Sur reported.
Malaga's week-long feria, held in August, draws thousands of people to the city.