Background: Evidence has shown that ibuprofen and celecoxib are effective in improving depressive symptoms, but their mechanisms of action are unclear. In this study, we aimed to determine the relationship between these two drugs and depressive disorder (DD) and elucidate potential mechanisms of action. Methods: Relevant targets for ibuprofen, celecoxib, and DD were obtained and screened from multiple online drug and disease public databases. A protein-protein interaction network was obtained. The Centiscape and CytoHubba plug-ins were applied to screen for core targets. Gene Ontology and Kyoto Encyclopedia of Genes and Genomes analyses were performed. Molecular docking was performed to predict the binding of ibuprofen and celecoxib to core targets. Examined the differences in core target protein expression between DD patients (DDs, n = 18) and healthy controls (HCs, n = 16) as a further experimental validation of the network pharmacology results. Results: In total, 220 potential targets for ibuprofen and 316 potential targets for celecoxib were identified and associated with DD. The antidepressant effects of both drugs involve many key targets in pathways such as "pathways in cancer" and "neuroactive ligand-receptor interaction," including ALB, BCL2, MAPK3, SRC, STAT3, EGFR, and PPARG. The binding affinity of ALB with ibuprofen is the strongest, and it is connected only by hydrophobic interactions. Celecoxib exhibits higher affinity at multiple targets such as SRC, EGFR, and PPARG, with stronger and more specific intermolecular interactions, including salt bridges and halogen bonds. Clinical trials have found that serum ALB expression in DDs is significantly lower than that in HCs (t = 6.653, p < 0.001), further confirming the potential role of ibuprofen in DD. Conclusions: Ibuprofen and celecoxib primarily exert their antidepressant effects through targets and pathways related to inflammation, neural signaling, and cancer, with celecoxib showing a stronger potential antidepressant effect. The expression difference of the core target ALB between depression and healthy individuals further supports the potential effect of the drug on DD. Our findings propose new treatment strategies, support the link between inflammation and depression, and encourage reassessing existing medications for depression.