For the integration of two-dimensional (2D) transition metal dichalcogenides (TMDC) with high-performance electronic systems, one of the greatest challenges is the realization of doping and comprehension of its mechanisms. Low-temperature atomic layer deposition of aluminum oxide is found to n-dope MoS2 and ReS2 but not WS2. Based on electrical, optical, and chemical analyses, we propose and validate a hypothesis to explain the doping mechanism. Doping is ascribed to donor states in the band gap of AlxOy, which donate electrons or not, based on the alignment of the electronic bands of the 2D TMDC. Through systematic experimental characterization, incorporation of impurities (e.g., carbon) is identified as the likely cause of such states. By modulating the carbon concentration in the capping oxide, doping can be controlled. Through systematic and comprehensive experimental analysis, this study correlates, for the first time, 2D TMDC doping to the carbon incorporation on dielectric encapsulation layers. We highlight the possibility to engineer dopant layers to control the material selectivity and doping concentration in 2D TMDC.