Yes and no.
The standard 5.9L created 230 hp (170 kW) @ 4,000 rpm and 330 lb·ft (449 N·m) @ 3,250 rpm. It was upgraded in 1998 to 245 hp (183 kW) @ 4,000 rpm and 335 ft·lbs (454 N·m) @ 3,250 rpm.
At the time of its introduction, the 5.2L Magnum created 230 hp (170 kW) @ 4,100rpm and 295 lb-ft of torque (410 N-M) @ 3,000rpm
Both the 5.2 and 5.9 Magnum engines in truck format featured the "safely tow a heavy trailer all day long" conservative factory fuel and igintion tune, terrible kegger intake, tiny throttle body and restrictive cast manifolds. They made comparable horsepower and torque numbers per cubic inch.. 15hp and 40ft/lb difference over all.
But in reality once you get rid of those restrictions and "bolt-on" both magnums into "300hp crate motor" spec the difference is gonna be closer to about 35hp and 85ft/lb in favor of the 5.9, possibly more.
Notice even in truck format the 5.9 makes it's peak torque at a higher RPM of 3250RPM vs 3000RPM for the 5.2, despite the fact that it's breathing through the exact same cylinder heads and intake manifold as the smaller motor? ordinarily, Everything being equal except for displacement the smaller engine would create it's peak torque at a later RPM .
This suggests that the camshaft in the 5.9 actually has more duration and/or the motor has higher compression. IMO probably both if accurately measured.
If you want 300hp, I highly recommend you pick the 5.9
If you are happy enough with closer to 270hp. I highly recommend you pick the 5.2 instead and save yourself $250 or so.