Yes this is complicated because the thumb button by default triggers cmd+tab.
You can try this:
spaceswitchmenu_x.bttpreset (86.0 KB)
I'm not sure whether the identifiers are the same on every system. After importing pressing the gesture button should behave like this. It may or may not need some adaptions for your system. Also I think it will only work if no Logitech software is installed