The photoluminescence (PL) response of GaN/AlGaN nanowire heterostructures (NWHs) to hydrogen and oxygen between room temperature and 300 °C is reported. Exposure of Pt-coated NWHs to H2 leads to an increase of the PL intensity attributed to the suppression of surface recombination by local dipole fields of adsorbed atomic hydrogen. When exposed to O2, uncoated NWHs show a decrease in PL intensity that is assigned to enhanced non-radiative recombination. The detection limits are below 5 ppm at 150 °C.