Toxic gas leakage in densely populated public areas can easily endanger people's safety and social stability. This paper establishes a pedestrian evacuation model based on cellular automata that considers the pedestrians' perception of casualties and environmental risks under the real-time spread of toxic gas. The model simulates the emergency evacuation process of pedestrians and their exit selection behavior in the toxic gas leakage incident at a passenger station. The simulation results indicate that evacuees' dynamic exit selection behavior regarding the risk perception of toxic gas incidents positively affects pedestrian evacuation. An optimal perception radius and toxic gas alarm conditions exist that minimize pedestrian casualties while maximizing evacuation efficiency. An increase in the exit change probability keeps pedestrians away from risk but may lead to congestion and reduce evacuation efficiency when the pedestrian density is high. The location of the toxic gas source has different impacts on casualties, and the dynamic exit selection rules prove more effective when the gas source is closer to one of two exits rather than being located between them.