Background: Multiple sclerosis (MS) is an autoimmune, inflammatory demyelinating, and disabling disorder of the central nervous system (CNS) with various clinical symptoms. Approximately 30% of the patients experience a variety of psychiatric problems during their disease course. Obsessive-compulsive disorder (OCD) is correlated with MS, but little is known about common molecular mechanisms of two diseases. Methods: In this study, after a comprehensive review of the existing literature, we collected almost all the genes involved in MS and OCD, and then analyzed the common genes between MS and OCD. Next, the connections and functional interactions between these three gene sets were investigated in the STRING database and analyzed in 3 separate networks by Cytoscape software. Eventually, after a multi-part enrichment analysis, we found the main molecular and cellular pathways, biological processes, brain areas, and, more importantly, cells/tissue related to the shared genes between MS and OCD. Results: Three genes of brain-derived neurotrophic factor (BDNF), tumor necrosis factor-alpha (TNFα), and neurexin-1 (NRXN1) are the major genes that were common between MS and OCD. Also, the deficit in synaptogenesis and neurotransmitter release in the nervous system are the most common complications of MS and OCD. Signaling receptor activity and estrogen receptor activity are the most important signaling pathways that are disturbed. Moreover, the presynaptic membrane, membrane raft, and growth cone are the main microenvironments that are affected in MS and OCD.Conclusions: In addition to an enrichment analysis that showed physical and functional interactions of genes related to MS and OCD, we demonstrated and predicted some new genes and microRNAs that can be promising biomarkers/targets for future experimental studies. Also, our finding indicated that neuroinflammation and synaptic plasticity are two significant pathological processes that are affected in MS and OCD.