This is most likely the rear wheel speed sensor, which is located on top of the differential housing.
Mopar part number is 05032220AA and is $18 Online at http://dodgeparts.mopar.com
(A graphic illustration can be found there too.)
I experienced the exact same problems on my 99 Dakota, and a new sensor fixed all the symptoms.
First I tried an aftermarket sensor from one of the chains, but it just did not fit right. Ended up buying one from Dodge, which popped right in. Take note on how the old sensor is situated before removal. Be careful when you remove the old sensor, slowly pry/wiggle it out. Take your time, you do not want it to brake and have debris fall into your differential. When you install the new one, lube the O-ring with Diff. fluid to ease it in.
From Dodge service manual:Removal
(1) Raise vehicle on hoist
(2) Remove brake line mounting nut and remove the brake line from sensor stud
(3) Remove mounting stud from sensor and shield
(4) Remove sensor and shield from differential housing.
(5) Disconnect sensor wire harness and remove sensorInstallation:
to sensor. Be sure seal is securely in place between sensor and wiring connector.
(2) Install O-ring on sensor (if removed)
(3) Insert sensor in differential housing
(4) Install sensor shield
(5) Install the sensor mounting stud and tighten to 24 N-m (200 in. lbs.)
(6) Install brake line on sensor stud and install nut
(7) Lower vehicle
I am no mechanic by any means, but it took me about 15 minutes to fix.