For such cases, separate third-party universal solution's could be used. IMHO, for Windows the best of them is excellent X-Mouse Button Control utility by Phillip Gibbons:
https://www.highrez.co.uk/downloads/XMo ... ontrol.htm
NB: note that generic Windows driver is capable to handle up to five mouse buttons (plus scrolling signals), so if particular device is equipped with more buttons or other controls, they can not be used without proprietary driver supporting them.X-Mouse Button Control (XMBC) allows you to create application and window specific profiles. This in turn, allows you to re-configure your mouse behaviour for individual applications or windows. For each profile you can also configure up to 10 'layers' of different button configurations which you can switch between using hot-keys or mouse buttons.
For Apple systems, there's USB Overdrive by Alessandro Levi Montalcini:
The USB Overdrive is a device driver for macOS that handles any USB or Bluetooth mouse, keyboard, trackball, joystick, gamepad or gaming device from any manufacturer and lets you configure it either globally or on a per-application, per-device basis.