DFT calculations at the B3LYP/6-311G* level were used to study 5-Fluoro-2-Oxo-1H-Pyrazine-3-Carboxa mide (OPC) adsorption onto four X12Y12 fullerene-like nanocages (X = Al/B; Y = N, P). We used bond distance, adsorption energy, charge analysis, frontier orbital analysis, dipole moment, AIM, RDG, and density of states calculations to investigate the relaxed structures of the adsorbed OPC on each nanocage. The interaction of the nucleophilic part of OPC (as an electron-donating substance) with the electrophilic part of nanocages results in the development of a bond between OPC and nanocage. The adsorption energy of OPC was calculated to be -284.48, -126.82, -121.81, -359.86, and -116.10 kcal/mol upon interaction with fullerene (FC), AlNC, AlPC, BNC, and BPC. Finally, because of the large fluctuations in their bandgap boron-containing nanocages are calculated to be superior drug sensors to aluminum-containing nanocages.