The development of NO2 gas sensors is of great importance for air quality monitoring and human health. In this work, In2O3 and zeolitic imidazolate framework-8 (ZIF-8) heterostructures were synthesized and designed as efficient sensing materials for NO2 detection. The ZIF-8 nanocrystals were uniformly deposited on In2O3 nanofibers (NFs) by using a self-template strategy, where In2O3/ZnO NFs act as the source of Zn2+ for the formation of ZIF-8 and as the template. By tuning the amount of Zn2+ in the composite NFs, different morphologies from In2O3 NFs with minimal ZIF-8 loading to an In2O3/ZIF-8 core-shell complex were obtained. The optimized In2O3/ZIF-8 NFs show a remarkably high response to 1 ppm NO2 (Rg/Ra = 16.4) and enhanced humidity resistance due to the hydrophobicity of ZIF-8 in comparison with those of the pristine In2O3 NF sensor (Rg/Ra = 4.9) at 140 °C. The gas sensing mechanism of In2O3/ZIF-8, which is based on electron transduction, surface chemistry, and the functional interface between the loaded ZIF-8 and In2O3 matrix, was proposed. Additionally, the large number of pores, which were formed by the in situ conversion of ZnO grains in the matrix, ensures that all parts of the In2O3 NFs are accessible to gases. This facile strategy paves the way for the design of metal oxide/MOF complex architectures with tunable metal centers for various applications, including gas sensing.