  We report a search for light dark matter produced through the cascading decay
of $\eta$ mesons, which are created as a result of inelastic collisions between
cosmic rays and Earth's atmosphere. We introduce a new and general framework,
publicly accessible, designed to address boosted dark matter specifically, with
which a full and dedicated simulation including both elastic and quasi-elastic
processes of Earth attenuation effect on the dark matter particles arriving at
the detector is performed. In the PandaX-4T 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 matter generated in
the atmosphere and nucleus through a light scalar mediator are obtained. The
lowest excluded cross-section is set at $5.9 \times 10^{-37}{\rm cm^2}$ for
dark matter mass of $0.1$ MeV$/c^2$ and mediator mass of 300 MeV$/c^2$. The
lowest upper limit of $\eta$ to dark matter decay branching ratio is $1.6
\times 10^{-7}$.
