Non-point source pollution is one of the crucial causes leading to degradation of rivers and lake water quality; therefore, it has been studied in depth worldwide. However, few studies exploring the effect of terrestrial ecosystem nutrient retention function on water quality have been conducted to date. Natural ecosystems such as forests and grassland can hold runoff and sediment, thereby reducing the nutrients entering nearby aquatic systems, which is very important to improving water quality. Based on the landscape source-sink theory, this study assessed the nutrient retention function of ecosystems. The results showed that terrestrial ecosystems retained 78% of the Total Nitrogen (TN) within the system, thereby significantly reducing the TN entering the water. The nutrient retention function of different ecosystems varied significantly. Forests had the greatest potential capacity to maintain TN, but the actual retained TN was only about 10% of that applied to cropland. Because of irrational land use patterns, the potential forest intercepting nutrient function was not fully utilized. Specifically, nutrient retention function varied with altitude and slope. When the altitude was in the range of 1000 m or between 4000 m and 4500 m, the highest function could be attained, resulting to increases or decreases between regions. The nutrient retention function decreased as slope increased. The critical source area (CSA) was primarily distributed along the river bank. However, the critical sink area which made a high contribution to nutrient reduction did not appear that similar distribution like CSA. The critical sink area scatted in the whole basin mainly and only overlapped with the critical source areas in some place.