Different approaches have been developed for evaluating Sobol’ indices for global sensitivity analysis (GSA). Among them sample-based approaches are extremely attractive because they can be purely driven by data and estimate various Sobol’ indices (e.g., first-order, higher-order, total-effects) for any individual or group of random variables using only one set of samples. However, such approaches usually rely on an accurate density estimation for the interested groups of random variables, which can be challenging for high-dimensional groups. For example, the commonly used kernel density estimation (KDE) suffers from curse of dimensionality. In this regard, this paper proposes a novel knowledge-enhanced machine learning approach for data-driven GSA for groups of random variables using sample-based approach and an emerging generative machine learning model, i.e., normalizing flows (NFs), for high-dimensional density estimation. To facilitate reliable and robust NFs training, a knowledge distillation-based two-stage training strategy is developed. Two customized loss functions are introduced, which are inspired by domain knowledge in the context of sample-based approach for GSA. Two examples are considered to illustrate and verify the efficacy of the proposed approach. Results show that introducing NFs can significantly alleviate the curse of dimensionality in the traditional sample-based approach for GSA and improve accuracy of density estimation and estimation of Sobol’ indices.