Other social activities, including voluntary work showed little evidence of helping people remain resilient while unemployed.
Going to religious services - including at churches - made a difference if the person attended at least once a week.
The research, conducted by the What Works Centre for Wellbeing in conjunction with East Anglia, Reading, Essex and Sheffield universities looked at unemployment in the UK and countries around the world.
The study also found that unemployment has the most negative impact on young men.
Nancy Hey, director of the What Works Centre for Wellbeing, said: "Work is a big factor when it comes to our mental health and wellbeing. When we are unemployed, we can struggle with isolation, meaning and a sense of purpose.
"Attending religious services seem to counteract the damage done by unemployment; it's a fascinating finding, and more research needs to be done."
Mark Bryan, Reader in Economics at the University of Sheffield and a co-author of the study, commented: "The research shows that our wellbeing depends on more than our individual experiences. Social support and being part of a community are important coping mechanisms for the unemployed."