Evaluating groundwater quality in irrigated areas is crucial for sustainable agriculture, especially as limited water resources and climate change pose significant threat to groundwater resources. Spatial information on groundwater quality is essential for effective management and utilization of water resources, particularly in intensive cropping areas such as irrigated regions in IBIS, Pakistan. However, recent advancements in machine learning (ML) techniques have highlighted that conventional groundwater quality assessment methods are costly and time-consuming, especially for developing nations. Accurate and efficient ML models can address this challenge in agricultural water management by optimally identifying the categories of water quality. This study is conducted to predict groundwater quality using an innovative ensemble-boosting methodology. The data is collected from Rahim Yar Khan’s irrigation system by the Scarp Monitoring Organization. Four irrigation water quality indicators, including sodium adsorption ratio, total dissolved solids, residual sodium carbonate, and electrical conductivity, are used to predict groundwater quality by applying four ML models. The performance of the ML models is assessed using mean squared error, correlation coefficients (r), and root mean square error measures. The proposed Gradient Boosting (GB) approach combines the advantages of interpretable tree models and boosting approaches. Experimental results validate the utility of the proposed approach with a 99% accuracy in predicting groundwater quality, compared to conventional ML techniques. Based on the proposed GB model and the inverse distance weighting interpolation technique, the groundwater quality distribution in the Hazardous Area is 17.34%, the Marginal Area is 79.36%, and the Safe Area is 3.30%. Enhancement and validation of groundwater quality index predictions are carried out using k-fold validation and hyperparameter tuning. Results indicate that the ML models have the potential to accurately delineate different groundwater quality zones for managing water resources and ensuring sustainable agriculture. Water quality assessment through the proposed approach can help managing the groundwater for the regions susceptible to deterioration of water quality thus contributing to better irrigation governance.