NSW police have used capsicum spray on fans at an A-League soccer match between the Western Sydney Wanderers and Perth Glory at Parramatta Stadium, with officers injured in the crowd violence.

They said the trouble began during Saturday night's match when fans in the northern stand set off a flare.

Wanderers fans took to social media to say a 13-year-old boy had to be hospitalised due to the effects of pepper spray. ( Twitter: Joel Mackett )

Police said they tried to remove the man they thought was responsible but had to use capsicum spray and call for backup when some in the crowd became aggressive.

They found the man they believe set off the flare, and banned him from the stadium.

Five people were treated for exposure to capsicum spray but none were taken to hospital.

Footage was uploaded to YouTube showing members of the Red and Black Bloc supporters group confronting police, with the officers responding with capsicum spray.

Wanderers fans also took to social media to say a 13-year-old boy had to be hospitalised due to the effects of capsicum per spray.

Tempers flared again at half time when about 150 fans outside the stadium threw cigarettes and coins at police.

Officers again used capsicum spray on the crowd and brought in the riot squad to disperse them.

Police said two senior police constables were treated for minor injuries.

One of them was struck in the face by a coin, while the other was kicked and punched in the back.

Police said they were working with stadium staff and club officials to identify those responsible.