Background: Ventilator-associated pneumonia (VAP) is a common infection complication in intensive care units (ICU). It not only prolongs mechanical ventilation and ICU and hospital stays, but also increases medical costs and increases the mortality risk of patients. Although many studies have found that thiamine supplementation in critically ill patients may improve prognoses, there is still no research or evidence that thiamine supplementation is beneficial for patients with VAP. The purpose of this study was to determine the association between thiamine and the prognoses of patients with VAP. Methods: This study retrospectively collected all patients with VAP in the ICU from the Medical Information Mart for Intensive Care-IV database. The outcomes were ICU and in-hospital mortality. Patients were divided into the no-thiamine and thiamine groups depending upon whether or not they had received supplementation. Associations between thiamine and the outcomes were tested using Kaplan-Meier (KM) survival curves and Cox proportional-hazards regression models. The statistical methods of propensity-score matching (PSM) and inverse probability weighting (IPW) based on the XGBoost model were also applied to ensure the robustness of our findings. Results: The study finally included 1,654 patients with VAP, comprising 1,151 and 503 in the no-thiamine and thiamine groups, respectively. The KM survival curves indicated that the survival probability differed significantly between the two groups. After multivariate COX regression adjusted for confounding factors, the hazard ratio (95% confidence interval) values for ICU and in-hospital mortality in the thiamine group were 0.57 (0.37, 0.88) and 0.64 (0.45, 0.92), respectively. Moreover, the results of the PSM and IPW analyses were consistent with the original population. Conclusion: Thiamine supplementation may reduce ICU and in-hospital mortality in patients with VAP in the ICU. Thiamine is an inexpensive and safe drug, and so further clinical trials should be conducted to provide more-solid evidence on whether it improves the prognosis of patients with VAP.