Penang police chief Comm Datuk Mohd Shuhaily Mohd Zain said the group went to the surau for prayers but were denied entry as the limit of 100 people was reached.
They then proceeded to perform their prayers on a road in front of the surau, which is near the Taman Pelangi flats in Auto City, Juru.
"The surau management had asked them to disperse and locked the gate to prevent further entry.
"As the surau respected the sensitivity of those who wanted to perform prayers and the incident happened spontaneously, they did not inform the police about the numbers outside.
"Police will now track down individuals who participated in the session between 8.30am and 9am," Comm Mohd Shuhaily told a press conference at the Central Seberang Prai district police headquarters in Bandar Perda.
Comm Shuhaily said there would usually be between 300 and 400 people at the surau for Hari Raya Haji prayers, before the movement control order was enforced.
He said there are about 8,000 residents in the neighbourhood and 70% of them are foreign workers who work in nearby factories.
A video of the gathering was widely circulated on social media earlier in the day.
In the 22-second video, apparently taken from a passing car, the crowd is seen praying with many appearing to be close to each other.
A source at the scene said the crowd had adhered to standard operating procedures (SOP).
"The surau allows a limited number of congregants inside.
"There was sufficient physical distancing among all those who were outside," the source said.
Takbir Raya (Raya prayers) are allowed at mosques and surau in areas that have moved to Phase Two of the National Recovery Plan.
The Malaysian Islamic Development Department (Jakim), in its SOP for the Aidiladha celebration, stated that prayers and sermons, as well as animal sacrificial rites, were also allowed, subject to permission from state religious departments.