IntroductionThe risk of new onset depression associated with sodium-glucose co-transporter 2 inhibitor (SGLT2I) use in patients with type 2 diabetes mellitus (T2DM) remains unclear. This study investigated the risk of new onset depression between SGLT2I and dipeptidyl peptidase 4 inhibitor (DPP4I) users.MethodsThis was a population-based cohort study of T2DM patients in Hong Kong between January 1st, 2015, and December 31st, 2019. T2DM patients over 18 with either SGLT2I or DPP4I use were included. 1:1 propensity-score matching using the nearest-neighbour method was conducted based on demographics, past comorbidities and non-DPP4I/SGLT2I medication use. Cox regression analysis models were used to identify significant predictors for new onset depression.ResultsThe study cohort included a total of 18,309 SGLT2I users and 37,269 DPP4I users (55.57% male, mean age: 63.5 ± 12.9 years) with a median follow-up duration of 5.56 (IQR: 5.23–5.8) years. After propensity score matching, SGLT2I use was associated with a lower risk of new onset depression compared to DPP4I use (HR: 0.52, 95% CI: [0.35, 0.77],P= 0.0011). These findings were confirmed by Cox multivariable analysis and sensitive analyses.ConclusionSGLT2I use is associated with significantly lower risk of depression compared to DPP4 use in T2DM patients using propensity score matching and Cox regression analyses.Supplementary InformationThe online version contains supplementary material available at 10.1007/s00592-023-02063-6.