A mother, whose son attends Plumpton High School, said the school was locked down after the incident and left "everyone" scared.
The people are believed to have sustained injuries to arms and legs.
Officers are yet to speak with the student allegedly behind the prank.
NSW Police said eight teenagers had been injured in the incident, sustaining "a minor needle prick".
The students were taken to a nearby medical centre and a hospital for urgent blood tests to find out if the needle was carrying infectious diseases like HIV or hepatitis.
Our men were on routine patrol near CBI chief's home: IB
This is a high security zone. "Unfortunately, their presence was projected otherwise", another official said. This also enables law enforcement agencies to respond immediately to developing situations, he added.
In a statement police said they had been told a student "was doing what appears to be a prank which involved a needle".
Multiple ambulance crews are treating victims at the scene.
Four ambulances and seven paramedics attended the school to assess the eight students. "Parents were immediately notified", the spokesman said.
"The Police are investigating this incident".
The NSW education department says staff and students are being offered counselling and support.