Even a gap of a few months?
So, yeah, if you are taking on someone who has been out of the workforce for a long time, you take on lots of risk. But once they are back in the workforce and getting good referrals, the gap shouldn't matter as much.
(And seeing it first hand: if you are having mental health problems, staying home and playing video games for 5 years will NOT make it better).