If I understand correctly, to get to the same desktop you are using NoMachine to connect, your friend is using another tool.
When you connect with NoMachine and the other tool to the same desktop, NoMachine is able to update the cursor position correctly when it is moved within the other tool’s session. So this is fine up to this point. But, the other tool you are using doesn’t update the cursor position when you are in a NoMachine session.
This would make it a problem of the other software you are using 🙂 Why not simply both of you use NoMachine?