Controversial evidence exists on the relationship between body mass index (BMI) and suicide attempts (SA) in patients with major depressive disorder (MDD). This cross-sectional study aimed to explore the association between BMI and SA in first-episode drug-naïve (FEDN) MDD patients in China. The study was conducted from 2016 to 2018 in Taiyuan, China. Univariate and multivariate logistic regression analyzed the BMI–SA association, with subgroup analysis for gender. Threshold effects were examined using two-piecewise regression. In males, BMI was significantly associated with SA (OR = 0.84, 95% CI 0.74–0.94, P = 0.003) after full adjustment, but not in females (OR = 0.97, 95% CI 0.89–1.06, P = 0.541). The interaction with gender was significant (P for interaction < 0.05). Smoothing plots revealed an L-shaped BMI–SA relationship in both genders, with BMI inflection points at 27.3 kg/m2 in males and 21.4 kg/m2 in females. Below the inflection points, BMI is negatively associated with SA in males (OR = 0.75, 95% CI 0.66–0.86, P < 0.001) and females (OR = 0.48, 95% CI 0.32–0.72, P < 0.001). Above the inflection points, no association existed for both genders (all P > 0.05). Results showed an L-shaped nonlinear BMI–SA relationship in FEDN MDD patients but differing BMI inflection points between genders, thus contributing to effective prevention programs for suicide.