A man married a woman, then divorced her. She married another man (Part No. 17; Page No. 364) and gave birth to one girl from that husband. Is it permissible for the first man to shake hands with the girl?
If a man marries a woman and consummates marriage with her, he is forbidden to marry her daughter for she becomes his step-daughter and his Mahram (unmarriageable relative). However, if he divorces the mother before consummating marriage with her, then her daughters will not be his Mahrams. Therefore, they should observe Hijab rules in his presence and he is not allowed to shake hands with them, for Allah (Glorified be He), specifies the female Mahrams in Surah An-Nisa',
...your step daughters under your guardianship, born of your wives to whom you have gone in - but there is no sin on you if you have not gone in them (to marry their daughters)
The phrase "you have gone into" indicates sexual intercourse. May Allah grant us success. May peace and blessings be upon our Prophet, his family and Companions.