The increased drought risk, stemming from global warming, has intensified ecological issues and consequently, positioned ecological drought as a significant research topic within the field of eco-hydrology. Nevertheless, due to limitations in the precision of spatiotemporal data, there remains a divergence of opinions regarding the primary water resources for vegetation growth in the northwest region of China, whether it be precipitation or groundwater. Consequently, this study endeavors to construct meteorological drought index, groundwater drought index, and ecological drought index, utilizing precipitation, groundwater storage anomaly, and ecological water deficit, respectively. The maximum correlation coefficient and residual analysis methods were used to analyze the joint and relative impacts of meteorological drought and groundwater drought on ecological drought. The primary findings can be summarized as follows: (1) The area dominated by the joint impact of precipitation and groundwater on the ecological drought variation accounts for about 60%, mainly distributed in arid and semi-arid regions. (2) In spring, summer, autumn, and winter, the average contribution of the joint impact of precipitation and groundwater to the increase in ecological drought variation is between 0.26 and 0.43. (3) In contrast to precipitation variation, ecological drought induced by groundwater scarcity predominantly impacts regions like southern Shaanxi, southeastern Gansu, and southern Qinghai. These areas represent between 12.7% and 21.8% of the total area.