Vitamin D deficiency and obesity are two public health problems extensively exacerbated over the last years. Among the several mechanisms proposed to account for the complex interplay between vitamin D and obesity, one that has gained particular attention is related to the emerging role of obesity-related changes in gut microbiota and gut-derived metabolites, such as Trimethylamine-N-oxide (TMAO). Vitamin D deficiency and high circulating TMAO levels are associated with body weight and the severity of non-alcoholic fatty liver disease (NAFLD). Considering the link of obesity with vitamin D on the one hand and obesity with TMAO on the other hand, and the central role of the liver in both the vitamin D and TMAO metabolism, the aim of this cross-sectional observational study was first, to confirm the possible inverse association between vitamin D and TMAO across different body mass index (BMI) classes and second, to investigate if this association could be influenced by the presence of NAFLD. One hundred and four adult subjects (50 males and 54 females; 35.38 ± 7.49 years) were enrolled. The fatty liver index (FLI) was used as a proxy for the diagnosis of NAFLD. Vitamin D deficiency was found in 65 participants (62.5%), while 33 subjects (31.7%) had insufficient levels, and the remaining subjects had sufficient levels of vitamin D. Subjects with both vitamin D deficiency and FLI-NAFLD had the highest TMAO levels (p < 0.001). By stratifying the sample population according to the BMI classes, vitamin D levels decreased significantly along with the increase of plasma TMAO concentrations, with the lowest vitamin D levels and highest TMAO, respectively, in class III obesity. Vitamin D levels showed significant opposite associations with circulating levels of TMAO (r = −0.588, p < 0.001), but this association was no longer significant after the adjustment for FLI values. The highest values of TMAO were significantly associated with the severity of obesity (OR 7.92; p < 0.001), deficiency of vitamin D (OR 1.62; p < 0.001), and FLI-NAFLD (OR 3.79; p < 0.001). The most sensitive and specific cut-off for vitamin D to predict the circulating levels of TMAO was ≤19.83 ng/mL (p < 0.001). In conclusion, our study suggests that high TMAO levels are associated with vitamin D deficiency and NAFLD. Further studies are required to investigate if there is a causality link or whether all of them are simply the consequence of obesity.