ANSWER:

You must not go to mixed gatherings to begin with.

Exchanging salam while lowering your gaze if you happen to meet is OK, without chit chatting or hanging out in the same room. 

Sheikh, there are some non-mahram relatives & in-laws in my family who practice islam & maintain hijab but they don’t cover their faces & start to talk out of courtesy. When I go there, I maintain my distance & avoid talking to them to the best of my ability. If I have to talk, then I stick to the basics as per your videos. Will I still be sinful? Please advise.