Correlation energy contributions from low‐lying states to density functionals based on an electron gas with a gap