Blocking internet access for a specific application on Mac OS X
You can use the Lulu open-source macOS firewall that aims to block unknown outgoing connections, unless explicitly approved by the user. Whilst it has a GUI, the set of blocked applications can be controlled via the command line by modifying the config file /Library/Objective-See/LuLu/rules.plist as explained in the Lulu webpage (near the bottom).