Police, who say that the five have confessed and have been charged with rape and violent assault, believe they swam from their boats to assault the group.
The two men were injured but managed to escape to raise the alarm.
When police and local people arrived at the scene the attackers ran off but were soon apprehended, according to police major general Nopparat Rinthaphol.
Thailand's Channel 7 television broadcast footage of locals trying to attack the men during the reenactment.
The victims have been taken to hospital on the mainland and the French embassy says it has sent officials to visit them.
Tourism accounts for at least 10 per cent of Thailand's GDP and the December-February period is peak season because the weather is cooler.
In September two Myanmar migrant workers were sentenced to death for the 2013 murder of two British backpackers, one of whom was raped, on the diving island of Koh Tao.
Defence lawyers argued they were scapegoated by local police under pressure to obtain results.
Violent attacks are rare, however, and traffic accidents claim far more tourists' lives.
Thailand was found to have the world's second most dangerous roads, after Libya, with 36.2 fatalities per 100,000 people, by a World Health Organisation study last year.