I know that it is not permissible to shake hands with a non-mahram woman, but what if she is a 5 year old girl or an old woman – is it permissible to shake hands with them?.
It is not permissible to shake hands with a non-mahram woman, because the Prophet (peace and blessings of Allaah be upon him) said: “For one of you to be stabbed in the head with an iron needle is better for him than to touch a woman who is not permissible for him.” Narrated by al-Tabaraani from the hadeeth of Ma’qil ibn Yasaar; classed as saheeh by al-Albaani in Saheeh al-Jaami’ (5045).
It makes no difference whether the woman is young or old, because of the general meaning of this hadeeth.
Al-Mawsoo’ah al-Fiqhiyyah (29/296).
The Standing Committee for Issuing Fatwas was asked: Is it permissible for an old woman to shake hands with a non-mahram man?
It is not permissible for an old woman or for any other woman to shake hands with a non-mahram man, because the Prophet (peace and blessings of Allaah be upon him) said: “I do not shake hands with women.” Narrated by Maalik, Ibn Maajah, Ahmad and al-Nasaa’i. This is general in meaning and includes both old and young, for fear of fitnah (temptation). End quote.
Fataawa al-Lajnah al-Daa’imah (17/47).
to young girls who are not regarded as desirable, those who are younger than
seven years, there is nothing wrong with looking at them or shaking hands
with them. It says in al-Insaaf (8/23): It is not forbidden to look
at the ‘awrah of a child below the age of seven, or to touch it. This was
stated by Imam Ahmad. Al-Athram narrated that there is nothing wrong with a
man putting a small girl in his lap and kissing her, so long as there is no
desire. End quote.