I remember when I thought I was a badass programmer. Now, after almost two decades of it, I realize how little I know. IMHO, humility is the best sign of experience. That said, asking for a hard number (like 5 years of experience) is no guaranteed filter, but it probably will get you way better application results than putting the threshold at 2 years.
One concrete benefit of requiring N years of experience, with N greater than 2, is that one of the major career learning experiences is to deal with one's own code in "maintenance mode", and you can only experience that if you have a number of years of distance from when you originally wrote the code.
Of course, requiring N years of experience is no guarantee that the candidate has dealt with this situation, as there are people who (consciously or not) structure their careers to avoid ever retreading their own code.