On-chip spectroscopic detection of terahertz radiation emitted from a quasiparticle-injected nonequilibrium superconductor using a high-Tc Josephson junction