How do you do this on macOS? I can't find anything under Settings > Mouse and I can't find a way of fluking it with various random gestures. I don't think I'll ever need it, I'm just curious!
TIL - after you wrote this, I just tested in Numbers, Brave, and Finder and this behavior did not work.
It seems that it only works in Firefox and I assumed it was an OS-level feature as I've used it so many times (and my most frequent need for such scrolling is the web, so I never noticed it's absent from other software)