1996 to 1998 GM truck 5.0's and 5.7's are the same engine schematics. All the connectors on the '97 5.0 should be the same as that on the '98 5.7.
However, the the two pcm's will have different parameters.
So run the '98 5.7 pcm. But, yet again, however, (dang) the differentials ratio of the two trucks my be different, and this will cause improper transmission shift points. If they are different then the 5.7 pcm will need to be flashed.
Do the two trucks have the same size diameter factory tires?
Also, MAF sensors are calibrated to specific pcm's so run the 5.7 MAF.
And check that the crankshaft position sensor reluctor wheels are the same. If they are different run the 5.7 reluctor.
Something else to check too is the transmission output shaft, and output shaft extension housing may be of different length.
You must be registered for see images
http://www.kohlerpower.com/onlinecatalog/pdf/tp6104.pdf
Link above provides torque specs, and engine specs.
Keep us posted on your progress.
-lee