The four men aged 20, 22, 24 and 30 and one woman, 27, face prison if they breach the terms of the injunction, which also bans them from certain streets in Mexborough and includes a six hour curfew.
The order was issued in court after a series of incidents, including arson attacks, criminal damage and assaults, in the town in recent months, blamed on tensions between two rival groups.
It is part of an ongoing operation by South Yorkshire Police to tackle antisocial behaviour, criminal damage and violence created by a small minority in the town.
As well as not associating in public with certain individuals, the gang members are barred from having golf clubs, baseball, rounders or cricket bats in any car they are travelling in or having the items in their possession publicly.
Superintendent Natalie Shaw of South Yorkshire Police said: “There have been a number of incidents in the town over the last few months including arson attacks, criminal damage and assaults, all of which we believe have been targeted attacks between two groups and number of those involved are now in prison.
“However, we understand the concerns in the community and that there are still issues in the area, and the interim gang injunction orders will hopefully offer some reassurance that we are exploring all avenues and options available to us to restore peace in the town.
“We have a continued, increased police presence in the area, including extra officers on patrol, mounted officers and various other police resources that have been deployed.”