The [NII] 205 μm line emission from high-z submillimeter galaxies and quasar host galaxies