The X-ray absorption near-edge structures (XANES) at the nitrogen K-edge of mercaptobenzothiazole (MBT), its anion, a chelate complex of this molecule, and its adsorbate on CdS (1 0 1 ̄ 0) exhibit distinct qualitative differences and characteristic peak shifts. It is shown that density functional theory (DFT) calculations of the respective systems in their electronic ground state can lead to an understanding of these spectral features. Their interpretation in terms of excitations into virtual molecular orbitals allows the assignment of the signals to functional groups in the chemical systems. By this means, the spectroscopic information on the adsorbate structure is confirmed and rationalized on a theoretical basis. It is deduced from the spectra that MBT is definitely adsorbed in its anionic form.