Edit your XF86Config file (or xorg.conf, depending on which XWindows-clone you use). Both conf files are usually found in /etc/X11
Look for the mouse settings section.. it'll look something like this:
Code:
Section "InputDevice"
# Identifier and driver
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
EndSection
What you want is the "ZAxisMapping" line. Add that to the same area in your config file, restart your X server, and you should have no problems.