This study aimed to examine the relationships between habitat quality and ecological properties including land use, elevation, slope, and soil parameters (SOC, phosphorus, and color parameters in the standard CIE L*a*b* color system), across the Ziarat Basin of the Gharehsoo River in northern Iran. Data from satellite imagery, field sampling, and previous reports were used to quantify habitat quality using InVEST, while soil properties were mapped using the IDW method. The relationships between all criteria were assessed using the ArcGIS Geostatistical Analyst and Pearson’s correlation coefficient. The impact of land use on habitat quality was also evaluated based on a subset of landscape metrics including NP, PD, LPI, LSI, and PCI. The results demonstrated that the southern habitats had higher quality than the northern parts of the basin. Habitat quality had a significant positive relationship with elevation (R = 0.9), slope (R = 0.77), SOC (R = 0.65), and a* parameter (R = 0.57), whereas it had a significant inverse relationship with phosphorus (R = − 0.61) and L* parameter (R = − 0.84). Moreover, elevation and slope had a significant positive correlation with SOC (R > 0.53) and a* parameter (R > 0.47), and a significant negative correlation with phosphorus (R < − 0.42) and L* parameter (R < − 0.76). The analysis of landscape metrics also revealed that an enhance in the number of rangeland and forest patches increase habitat quality, whereas increasing agricultural and built-up land uses downgrade habitat quality. Conclusively, habitat quality can be correlated to landform and soil properties influenced by spatial patterns and land use types, which facilitate the understanding of ecological characteristics and land degradation.