Our study aimed to evaluate the association between gastric cancer (GC) and higher concentrations of the metabolites L-carnitine, γ-butyrobetaine (GBB) and gut microbiota-mediated trimethylamine N-oxide (TMAO) in the circulation. There is evidence suggesting that higher levels of TMAO and its precursors in blood can be indicative of either a higher risk of malignancy or indeed its presence; however, GC has not been studied in this regard until now. Our study included 83 controls without high-risk stomach lesions and 105 GC cases. Blood serum L-carnitine, GBB and TMAO levels were measured by ultra-high-performance liquid chromatography–mass spectrometry (UPLC/MS/MS). Although there were no significant differences between female control and GC groups, we found a significant difference in circulating levels of metabolites between the male control group and the male GC group, with median levels of L-carnitine reaching 30.22 (25.78–37.57) nmol/mL vs. 37.38 (32.73–42.61) nmol/mL (p < 0.001), GBB–0.79 (0.73–0.97) nmol/mL vs. 0.97 (0.78–1.16) nmol/mL (p < 0.05) and TMAO–2.49 (2.00–2.97) nmol/mL vs. 3.12 (2.08–5.83) nmol/mL (p < 0.05). Thus, our study demonstrated the association between higher blood levels of L-carnitine, GBB, TMAO and GC in males, but not in females. Furthermore, correlations of any two investigated metabolites were stronger in the GC groups of both genders in comparison to the control groups. Our findings reveal the potential role of L-carnitine, GBB and TMAO in GC and suggest metabolic differences between genders. In addition, the logistic regression analysis revealed that the only significant factor in terms of predicting whether the patient belonged to the control or to the GC group was the blood level of L-carnitine in males only. Hence, carnitine might be important as a biomarker or a risk factor for GC, especially in males.