As a species for ecological restoration in northern China, Tamarix ramosissima plays an important role in river protection, flood control, regional climate regulation, and landscape construction with vegetation. Two sampling sites were selected in the hillside and floodplain habitats along the Lanzhou City, and the xylems of T. ramosissima and potential water sources were collected, respectively. The Bayesian mixture model (MixSIAR) and soil water excess (SW-excess) were applied to analyze the relationship on different water pools and the utilization ratios of T. ramosissima to potential water sources in two habitats. The results showed that the slope and intercept of local meteoric water line (LMWL) in two habitats were smaller compared with the global meteoric water line (GMWL), which indicated the existence of drier climate and strong evaporation in the study area, especially in the hillside habitat. Except for the three months in hillside, the SW-excess of T. ramosissima were negative, which indicated that xylems of T. ramosissima are more depleted in δ2H than the soil water line. In growing seasons, the main water source in hillside habitat was deep soil water (80~150 cm) and the utilization ratio was 63 ± 17% for T. ramosissima, while the main water source in floodplain habitat was shallow soil water (0~30 cm), with a utilization ratio of 42.6 ± 19.2%, and the water sources were different in diverse months. T. ramosissima has a certain adaptation mechanism and water-use strategies in two habitats, and also an altered water uptake pattern in acquiring the more stable water. This study will provide a theoretical basis for plant water management in ecological environment protection in the Loess Plateau.