The girl underwent a three-hour surgery at the All India Institute of Medical Sciences (AIIMS). Doctors say her severe external and internal injuries suggest she may have been sexually assaulted. The deep cuts on her neck narrowly missed her windpipe, they said.
"The girl is in ICU. She is vitally stable. We hope she will be out of danger soon," said Dr Sanjeev Bhoi, Additional Medical Superintendent at AIIMS.
An attendant at the public toilet has been arrested and 22 others detained. The police are questioning them.
The girl lives in a slum close to the toilet where she was attacked.
Last week, a five-year-old girl was kept captive and raped in a room below where her family lives in East Delhi, allegedly by her neighbour and another man. They locked her in the room and fled. The child lay bleeding and without food or water for two days until her mother heard her cries and called the police.