  The energy deposition spectra of $^{37}$Ar and $^{71}$Ge in a miniature
proportional counter are measured and compared in detail to the model response
simulated with Geant4. A certain modification of the Geant4 code, making it
possible to trace the deexcitation of atomic shells properly, is suggested.
Modified Geant4 is able to reproduce a response of particle detectors in detail
in the keV energy range. This feature is very important for the laboratory
experiments that search for massive sterile neutrinos as well as for dark
matter searches that employ direct detection of recoil nuclei. This work
demonstrates the reliability of Geant4 simulation at low energies.
