To guarantee the secure functioning of the complete power system and minimize the risks associated with oil-filled transformers during their operation, it is greatly important to carry out gas sensing studies of dissolved gases in transformer research. Through the utilization of first-principles density functional theory calculations, the adsorption energy, electronic characteristics, and recuperation duration of ZrS2 modified with Sc and Ti were examined. The results show that compared to those of the initial ZrS2 material, the doping of TM atoms Sc and Ti significantly improved the adsorption properties of the material, and the adsorption of CO and C2H4 showed chemisorption. The adsorption capacity for gases decrease in the following order: C2H4 > CO > H2. The calculated recovery times indicate that Sc-ZrS2 and Ti-ZrS2 were ideal carbon monoxide sensing materials under the specific conditions. The results of this work can establish a fundamental rationale for the use of ZrS2 in sensing the conditions of oil-immersed transformers.