I don't know GOG's policy on this. Steam and DRM free versions can play multiplayer together.
I know GOG has a policy of allowing cross platform multiplayer. You might have seen the beta of GOG galaxy, the GOG alternative to the Steam API.
I recall someone confirming that it works - I have not tried it. One thing is for sure the version/patch number need to be the same among all players. So if some use steam they should turn off automatic updates since they might otherwise get a version newer than the one on GOG.