Background Nonsuicidal self-injury (NSSI) is recognized as a public health concern for its association with unfavorable outcomes, including suicidal behavior. The aim of this study is to identify factors associated with NSSI among patients with nonpsychotic mental disorders (NPMD) and suicidal ideation in Russia. Methods A retrospective cohort study was conducted in the Moscow Research and Clinical Center for Neuropsychiatry between November 2017 and May 2019. The sample was composed of consecutive patients with lifetime suicidal ideation (from the Self-Injurious Thoughts and Behavior Interview) seen in the center’s psychiatric ward for NPMD. The patients were divided into two groups: those with and without lifetime NSSI. Sociodemographic variables, psychiatric diagnosis, family history of mental disorders, history of physical or sexual abuse, sexual behavior, ad-hoc psychiatric treatments, suicidal ideation, plans, and gestures or attempts were investigated. Results Six thousand, two hundred and four consecutive patients were screened for suicidal ideation. Out of a total of 361 patients (87.3% females) with suicidal ideation, 217 (60.1%) reported NSSI. Variables independently associated with NSSI included age <25 years (OR 6.0, CI 2.5–14.7), dissatisfaction with the perceived parenting style (OR 3.3, CI 1.5–7.4), bullying (OR 2.6, CI 1.0–6.5), severe body modifications (OR 11.9, CI 1.1–134.3), experience with illicit drugs (OR 4.4, CI 1.9–10.3), and eating disorders (OR 4.9, CI 2.0–11.8).