Program my Logitech M545 Mouse for Mac
Mac-compatible Logitech mouses come with a preference pane to program their features.  Or (even if not Mac-compatible) try a third-party mouse-button utility, like SteerMouse, $20.

edit
Here is the post about using the Logitech M325 on Mac.  Maybe that will work in other cases, too.