from listening to your symptoms i'd say you have no voltage going to that brown wire or the gem ground is faulty.
A bad fuse, gem, wiring, front, or rear driveshaft sensors, ecm, could all effect this problem
the way it seems on these 97's is that in order to have the variable electromagnetic hub lock the front driveshaft in place in the transfer case. that brown wire needs to be carrying voltage from the gem module to the transfer case. from what they say it should be easily accessed behind the radio in the dashboard.
If you take a voltage tester and probe the brown wire while the selector is in 4x4 low in neutral with brake on, it should read voltage to ground. if no voltage, it sounds like you could cut it and take the lighter feed and energize the brown wire going to the transfer case, but ask one of the experts first. If it locks in, you know the gem module isn't feeding voltage to the magnet. those hall sensors make the torque on demand module vary or pulse the voltage to adjust the magnet for applying full to all locked front driveshaft to low voltage slippage of the front driveshaft.
at that point the easiest way would be take it to ford so they can read the error codes. the ecm reads the sensors signals so the gem may be fine, and one of the sensors may be bad, or the tod may be bad, or just a bad wire
If you want to spend around three hundred bucks, I think autotap obd ll/can has fords extended software that reads these codes. But a ford dealer is cheaper