The purpose of this study is to identify medications with potentially beneficial effects on decreasing mortality in patients with acute kidney injury (AKI) while in the intensive care unit (ICU). We used logistic regression to investigate associations between medications received and ICU mortality in patients with AKI in the MIMIC III database. Drugs associated with reduced mortality were then validated using the eICU database. Propensity score matching (PSM) was used for matching the patients’ baseline severity of illness followed by a chi-square test to calculate the significance of drug use and mortality. Finally, we examined gene expression signatures to explore the drug’s molecular mechanism on AKI. While several drugs demonstrated potential beneficial effects on reducing mortality, most were used for potentially fatal illnesses (e.g. antibiotics, cardiac medications). One exception was found, ondansetron, a drug without previously identified life-saving effects, has correlation with lower mortality among AKI patients. This association was confirmed in a subsequent analysis using the eICU database. Based on the comparison of gene expression signatures, the presumed therapeutic effect of ondansetron may be elicited through the NF-KB pathway and JAK-STAT pathway. Our findings provide real-world evidence to support clinical trials of ondansetron for treatment of AKI.