Yes, the FM146 is a drop in replacment for a 4WD M5OD with the right bellhousing pattern. Both are the same length as the A4LD.
You can reuse your existing transfer case and driveshafts with it.
An M5OD from behind a 4WD 2.9L will work as well, though these aren't all that easy to find (most had FM146s). The gear ratios are not the same -- 2.9Ls are slightly wider.
A 2WD M5OD will NOT work. Don't even ask about "converting." An M5OD from behind a 3.0L or any 4banger will NOT work, unless you are highly skilled at cutting and welding cast aluminum.