Can't think of an exact match off hand, Marianna, but there is the common saying "it takes one to know one", typically used as a retort to someone commenting adversely on your status as, for example, a liar.