We report a sensitive search for light dark matter originating from cosmic ray inelastic collision with the atmosphere using the PandaX-4T detector. A full and dedicated simulation including both elastic and quasi-elastic processes of the Earth attenuation effect on the dark matter flux arriving at the PandaX-4T detector is performed. In the commissioning data of 0.63 tonne$\cdot$year exposure, no significant excess over background is observed. The first constraints on the interaction between light dark matters from atmosphere and nucleus with a light scalar mediator are obtained.