I’m running into a very similar problem. I have NoMachine installed on a Win10 box and two Ubuntu boxes. All three can get to the desktop on the Windows machine, and the first Ubuntu box. Only the second can get to the second Ubuntu box, via its network IP address (192.168.200.120). “lsof” shows the same four entries as above.
I’ve tried the “ufw allow 4000”, as well as manually flushing the iptables, and even disabling the firewall and rebooting. Nothing works. I’ve even tried uninstalling it and re-installing it. The weirdest thing is that it worked once when I first installed it, but never again.