Dementia is a major concern among growing chronic diseases in the aging society and its association with polypharmacy has not been adequately assessed. The objective of this study was to determine the association between polypharmacy and dementia through multiple statistical approaches. We conducted a nested case-control study for newly diagnosed dementia cases using the South Korean National Health Insurance Service sample cohort database (2002–2013, n = 1,025,340). Interactions between polypharmacy (an average use of ≥5 prescription drugs daily) and comorbidities or potentially inappropriate medications (PIMs) were tested. The odds ratios (ORs) for dementia were analyzed according to the presence of comorbidities, PIM uses, the average number of prescribed daily drugs, and significant interactions with polypharmacy using univariate and multiple logistic regression analyses. A higher prevalence of comorbidities, history of PIM use, higher PIM exposure, and higher proportion of polypharmacy were noted among cases than in controls. In the univariate analysis, the OR for dementia increased significantly with the increase in the number of prescribed drugs [1–<5 drugs: 1.72, 95% confidence interval (CI): 1.56–1.88; 5–<10 drugs: 2.64, 95% CI: 2.32–3.05; ≥10 drugs: 3.35, 95% CI: 2.38–4.71; <1 drug used as reference]. Polypharmacy was correlated with comorbidities and PIM use, and significant interactions were observed between polypharmacy and anticholinergics; H2-receptor antagonists; and comorbidities such as hypertension, peripheral or cerebrovascular disease, congestive heart failure, hemiplegia, diabetes, depression, all other mental disorders, chronic obstructive pulmonary disease, peptic ulcer disease, and chronic liver disease (p<0.001). In the multiple regression analysis, most cases exhibited increasing ORs for dementia with increasing polypharmacy levels. Moreover, the increase in OR was more evident in the absence of drugs or comorbidities that showed significant interactions with polypharmacy than in their presence. Polypharmacy increases the risk of PIM administration, and as some PIMs may have cognition-impairing effects, prolonged polypharmacy may result in dementia. Therefore, efforts are needed to limit or decrease the prescription of medications that have been associated with risk of dementia in the elderly.