Heterostructures have promising applications in photonics and optoelectronics, mainly due to their high electron mobility and broadband photoresponse covering visible, infrared, and terahertz (THz) ranges. However, it is challenging to detect heterostructures in high definition with conventional THz techniques. Here we demonstrate a THz nanoscopic imaging method which is capable of resolving the local THz response of PbS-graphene heterostructures based upon a sophisticated THz near-field optical microscope. The interaction between the THz near field and the heterostructure is further explored by numerical simulations. The results reveal that both the composition and structure of the layers composing the heterostructure contribute to the THz signal. Furthermore, we develop a reliably finite dipole model suitable for retrieving THz optoelectronic properties of multilayered systems from measured THz hyperspectra, and realize mapping the local effective permittivity and conductivity of the heterostructure. Our work discloses the mechanism of the THz response of heterostructures, and provides a useful method for high-definition quantifying complex THz materials and devices.