We report a MoS2/GaN heterojunction-based gas sensor by depositing MoS2 over a GaN substrate via a highly controllable and scalable sputtering technique coupled with a post sulfurization process in a sulfur-rich environment. The microscopic and spectroscopic measurements expose the presence of highly crystalline and homogenous few atomic layer MoS2 on top of molecular beam epitaxially grown GaN film. Upon hydrogen exposure, the molecular adsorption tuned the barrier height at the MoS2/GaN interface under the reverse biased condition, thus resulting in high sensitivity. Our results reveal that temperature strongly affects the sensitivity of the device and it increases from 21% to 157% for 1% hydrogen with an increase in temperature (25-150 °C). For a deeper understanding of carrier dynamics at the heterointerface, we visualized the band alignment across the MoS2/GaN heterojunction having valence band and conduction band offset values of 1.75 and 0.28 eV. The sensing mechanism was demonstrated based on an energy band diagram at the MoS2/GaN interface in the presence and absence of hydrogen exposure. The proposed methodology can be readily applied to other combinations of heterostructures for sensing different gas analytes. © 2019 IOP Publishing Ltd.