All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Talking to a non-Mahram woman is permissible when needed and when one is secure from temptation, but this should only be according to the need and without being in seclusion with her.
As for talking to her without need or when there is fear of temptation, then it is not permissible.
The prominent scholar al-Khaadimi said in his book entitled Bareeqah Mahmoodiyyah:
“Speaking with a young woman is not permissible without need because it is thought that this will be a reason for temptation.”
If there is a necessity or need to talk with a woman without the people hearing their conversation, then there is no harm for moving away from the people so that they would not hear their conversation, whether it is something one is ashamed of, or a special matter, such as trade and so forth. However, it should be with the condition that they could be seen by the people.
Ibn Hajar said in Fath al-Baari: “His saying: “Chapter: When it is permissible for a man to be in seclusion with a woman while being seen by other people; meaning he does not stay in seclusion with her in a way that they are not seen by other people, but only as far as they could not hear their conversation if it is something that should be said in privacy, such as something a woman is ashamed of mentioning it in front of the people.” [End of quote]
If the conversation is online and the like, then it is not a condition to be in a group, but it is a condition that one is secure from temptation and free of suspicion.
For more benefit, please refer to Fataawa 322891 and 30911.
Allah knows best.