Rescue crews were called to the unit block of Amy Court in North Wales, Pennsylvania, for reports of people starting to get sick.
Fire officials say a strong chemical odor, later identified as ammonia, was detected in the air.
It was being used as part of a cleaning solution for power washing, authorities say.
The four residents and firefighter involved in this incident are expected to be OK, police say.