The short answer is YES a early (87-91) first Gen Dakota rear axle is almost a direct bolt in for a MJ/XJ, But there are a few differences. First, similarities, same dimensions spring perch to spring perch, backing plate to backing plate and drum to drum. Same 5 on 4 1/2" bolt pattern. Same 27 spline axles. Now the differences (mostly good), larger U joint and yoke, larger brakes, lots of 2 WD Dakotas came with Limited Slip. 4WD Dakotas, spring over, 2WD spring under. Dakota shock mounts welded to axle tube.
We own 2 XJ's and 2 first gen Dakotas, a 87 and a 92 and have been comparing parts between them for quite a while.