Weighted gene co-expression network analysis and machine learning identified <i>CD40LG</i> as a potential molecular bridge between depression-associated immune modules and MASLD. Here, CD40LG is linked to depressive symptom measurement.