This study reports the nonlinear optical (NLO) properties of the exohedral adsorption of N-(4-methoxybenzylidene) isonicotinohydrazone (INH) onto B12N12 and Al12N12 nanocages. All ground state computations were performed using the density functional theory (DFT) method at the B3LYP-D3/6-311G(d,p) level of theory in the gaseous phase. Excited state computations were achieved via the time-dependent density functional theory (TD-DFT) at the CAM-B3LYP/6-311G(d,p) level of theory. Molecular electrostatic potential (MEP) analysis of INH reveals the presence of three preferential interaction sites: the O-atom of carbonyl (site 1), the N-atom of pyridine (site 2), and the N-atom of the azomethine group (site 3). The highest interaction energy values for the adsorption of INH onto the B12N12 and Al12N12 were −43.560 and −52.724 kcal·mol−1, respectively, indicating a chemisorption process. The computed Gibbs free energy change (ΔGad) and adsorption enthalpy change (ΔHad) values for all complexes studied are negative, indicating that the adsorption process is spontaneous and exothermic. Quantum theory of atoms in molecules (QTAIM) analysis reveals that the adsorbate-adsorbent interactions are partially covalent, which agrees with the reduced density gradient (RDG) analysis. Exohedral adsorption on the nanocages reduces the band gap, which ranges between 2.851 eV and 6.748 eV, according to density of state (DOS) diagrams. Furthermore, the first and second hyperpolarizabilities (βtot and γtot) were also determined. The outcomes show that adsorption improves these values over INH, and the complexes could be useful materials in optoelectronics and the development of more responsive NLO devices.