Herein, we investigated the photocatalytic activity and photoresponse of pristine ZnO and NiO, as well as ZnO-NiO heterojunction grown by the sol-gel dip-coating method on glass substrates. The obtained samples were characterized via X-ray diffraction (XRD), field-emission scanning electron microscopy (FE-SEM), energy-dispersive X-ray spectroscopy (EDS), high-resolution atomic force microscopy (AFM), and UV-vis spectroscopy. Structural, optical, and morphological studies have demonstrated the presence of two phases of zinc and nickel oxides. The photocatalytic activity of the coatings was evaluated by methylene blue (MB) degradation under natural sunlight illumination for 150 min. The p-n ZnO-NiO heterojunction enhanced the degradation rates, exhibiting superior photocatalytic activity by degrading 96.73% in 150 min compared to pristine ZnO (74.56%), and pristine NiO (42.83%). Furthermore, the thin film demonstrated higher stability, reusability, and recoverability after five cyclic tests, rendering it suitable for wastewater purification. Based on the sensitivity, responsivity, and detectivity of the ZnO-NiO heterojunction sample to light, exposure to UV light irradiates the photocatalysts to generate electrons and holes, thus inducing a photocurrent.