The study used machine learning to identify key immune-related genes (IRGs) that are common to systemic lupus erythematosus (SLE) and diffuse large B-cell lymphoma (DLBCL). Univariate analysis and machine learning confirmed that the CD247 gene is a common key gene in both diseases. High expression of CD247 enhances T-cell-mediated antitumor immunity by regulating CD8+ T cell infiltration. Cell experiments showed that overexpression of CD247 inhibits cell cycle progression and promotes apoptosis in DLBCL cells. SLE is a risk factor for DLBCL, but the shared molecular mechanisms are not yet fully understood. The CD247 gene is involved in the immune response and can induce apoptosis and cell cycle changes in SLE-induced DLBCL.