Background: Endometriosis is defined as the presence of functioning endometrial tissue in extra uterine structures that causes pain, infertility and reduced quality of life. Diet plays an important role in the modulation of endometriosis. Aim: This study aimed to evaluate the association between the dietary inflammatory index (DII) score and the endometriosis compared to healthy people in a case-control study in Iran. Methods: This study included 78 women with laparoscopically confirmed endometriosis and 78 women with normal pelvis. The DII was calculated from dietary intake assessed using a validated food frequency questionnaire. The association between DII scores (divided in tertiles) and endometriosis risk was investigated using logistic regression analysis and reported as odds ratios (ORs) and 95% confidence intervals (CI) adjusted for age, energy, BMI, education, para, smoking, pelvic pain, menorrhagia, stage of endometriosis, physical activity, and income. Results: In the age-adjusted models, subjects who consumed more pro-inflammatory diets (the upper tertile of DII) had an OR of 2.24 (95% CI = 2.03, 3.91) as compared to subjects in the lowest tertile. Also after multivariable adjustment, women in the highest tertile of DII (versus lowest tertile) were more likely to have endometriosis (OR 2.63; 95% CI 1.88–2.91, p = 0.004). Conclusion: Our results suggest that women with more consumption of pro-inflammatory diet were at increased endometriosis risk.