Metal-organic frameworks (MOFs), constructed from organic ligands that are rich in conjugated π bonds, have been gaining significant attention for gas sensing. This paper reports the synthesis of Nb-H2BIPA-TC, an octahedral MOF, starting from niobium as the metal centre and benzoimidephenanthroline tetracarboxylic acid (H4BIPA-TC) as the ligand. The Nb-H2BIPA-TC-MOF was grown under light irradiation on the surface of a lithium niobate waveguide substrate and assessed for its ability to sense acidic and basic gases. The Nb-H2BIPA-TC-MOF formed an octahedral crystal structure after being grown for only 20 min. The obtained film was optically transparent and featured low light attenuation (< 1.28 dB mm−1). Owing to the Lewis acid-base nature of the Nb-H2BIPA-TC-MOF, the designed sensor exhibited a specific ‘turn on-off’ sensing response to H2S, SO2, and ethylenediamine (EDA) gases. The host-guest interaction between the gas-sensitive Nb-H2BIPA-TC -MOF and different analyte gases induced different degrees of ‘on-off’ switching in its refractive index. The designed MOF showed a significant and reproducible ‘turn on-off’ response to H2S and EDA gases in the 0.1–100 ppm concentration range. The designed MOF responded to these two gases for at least 28 days with a 10–23 % reduction in the sensing response per 7 days. Owing to its low immunity to relative humidity, the designed MOF can be employed under low humidity conditions for the detection of H2S/SO2 and EDA.