Question about online multiplayer. - eviltoast

I apologize, I’ve been out of the loop for more than a decade with piracy, so I have a dumb question.

My friend has a cracked version of Baldur’s Gate 3 (GOG, I think) and I want to play online with him. I don’t mind actually buying the game for myself on Steam so I can install it on both my Mac and Deck, but I don’t want to spend the money if it means a legit copy that doesn’t play nice with his cracked copy.

Can cracked games play online with legit games, would I need a cracked copy as well, or is online MP simply out of the question?

Thanks to anyone willing to give a response.