I agree with the above, don't use the 4E ECU on the 5E. Even if the pin outs are a direct plug in, in any condition when the 5E wants max fuel and the amount the 4E ECU delivers is less than this, you will run lean and do $$$ of damage.
And yes, the 5E should be a direct bolt in, but if I was you I would look at a 4E-FTE half-cut and bolt that in instead.
I think with a 97 you have an EP90 Starlet, look for a turbo EP90 half-cut.
Mitch.