Extreme-mass-ratio inspirals (EMRIs) could be detected by space-borne gravitational-wave (GW) detectors, such as the Laser Interferometer Space Antenna (LISA), TianQin, and Taiji. Localizing EMRIs by GW detectors can help us select candidate host galaxies, which can be used to infer the cosmic expansion history. In this paper, we demonstrate that the localization information can also be used to infer the formation channel of EMRIs, and can hence allow us to extract more precisely the redshift probability distributions. By conducting mock observations of the EMRIs that can be detected by TianQin and LISA, as well as the galaxies that can be provided by the future Chinese Space Station Telescope, we find that TianQin can constrain the Hubble–Lemaître constant H 0 to a precision of ∼3%–8% and the dark energy equation-of-state parameter w 0 to ∼10%–40%. The TianQin+LISA network, by increasing the localization accuracy, can improve the precisions of H 0 and w 0 to ∼0.4%–7% and ∼4%–20%, respectively. Then, considering an illustrative case in which all EMRIs originate in active galactic nuclei (AGNs), and combining the mock EMRI observation with a mock AGN catalog, we show that TianQin can recognize the EMRI–AGN correlation with ∼1300 detections. The TianQin+LISA network can reduce this required number to ∼30. Additionally, we propose a statistical method to directly estimate the fraction of EMRIs produced in AGNs, f agn, and show that observationally deriving this value could significantly improve the constraints on the cosmological parameters. These results demonstrate the potentials of using EMRIs as well as galaxy and AGN surveys to improve the constraints on cosmological parameters and the formation channel of EMRIs.