Check out steermouse.jp. Solves the same problem. Been using it for many years. Replaced crappy Razer software on my Mac.
Steermouse the easiest to use with most functionality so far compared to Sensible Side Buttons, USB Overdrive, ControllerMate. I tried out Steermouse for past couple of weeks. Just paid for it yesterday... but noticed the CPU usage today.