Residents heard cries from a public toilet block and notified police, according to the Beijing Times.
"Her head was upside down and her body was falling into the drain. We could only vaguely see her feet from the side," Qian Feng, the local police chief told the paper.
Qian said initially police decided to dismantle the toilet as the drain structure was unclear, but that would take too long.
"There is a right-angled pipe inside the train, and the baby was almost trapped in the horizontal pipe," Qian told the Beijing Times.
After being pulled safely out of the pipe, residents helped police wrap the baby up before she was sent to a nearby hospital.
As of Monday night, she was in a stable condition, the newspaper said. It added that she had no apparent physical defects.