Coupling coordination degree (CCD) between persistent late-night radiance and population density may vary nonlinearly with urban functional density, yet linear and single-city analyses cannot distinguish shared from city-specific patterns. A method-controlled dual-city XGBoost-SHAP framework was applied to 14,215 H3 cells in Shanghai and 31,067 in Beijing using six point-of-interest density factors. XGBoost outperformed OLS, with random hold-out R2 values of 0.899 and 0.918 vs. 0.617 and 0.626. Public service (X2) ranked first in both cities, accounting for 39.77% and 58.73% of total mean absolute SHAP magnitude. The secondary hierarchy diverged as follows: commercial finance (X3) ranked second in Shanghai at 27.91% and formed the strongest interaction with X2, whereas transport infrastructure (X6) ranked second in Beijing at 18.63% and formed the strongest interaction with X2. Nonlinear analysis identified reproducible negative-to-positive crossings for X2, X3, and X6, peak-type responses for X4 and X5, and no stable second saturation threshold. Spatial OOF, grid, rank, LOWESS, and residual checks supported the leading-factor contrast while showing scale sensitivity and residual spatial dependence. The results identify a common leading attribution alongside city-specific secondary, nonlinear, and spatial patterns within the two observed megacities.