  Massive black hole binaries (MBHBs) could be the loudest gravitational-wave
(GW) sources in milli-Hertz (mHz) GW band, but their dynamical evolution may
stall when the black holes reach the innermost parsec of a galaxy. Such a
"final-parsec problem" could be solved if MBHB forms in a gas-rich environment,
such as an active galactic nucleus (AGN), but other solutions not involving
AGNs also exist. Testing the correlation between these mHz GW sources and AGNs
is difficult in real observation because AGNs are ubiquitous. To overcome this
difficult, we use a statistical method, first designed to constrain the host
galaxies of stellar-mass binary black holes, to search for a MBHB-AGN
correlation in different astrophysical scenarios. We find that by detecting
only one MBHB at $z \lesssim 0.5$, a mHz GW detector, such as the Laser
Interferometer Space Antenna (LISA), can already distinguish different merger
scenarios thanks to the precise localization of the source. Future detector
networks and deeper AGNs surveys can further testify the MBHB-AGN correlation
up to a redshift of $z\sim 2$ even if only a small fraction of MBHBs merge
inside AGNs. These constraints will help settle the long-standing debate on the
possible solutions to the final-parsec problem.
