Extension of the spectral distribution method to many-quasiparticle subspaces