Pre 99.5 4.2's are 4 valve engines.
Post 99.5 4.2's are 5 valve engines.
There will be a meriad of detail changes, though from a basic perspective there's probably no reason why you couldn't swap it in.
The additional power of a later S8 engine is as much the ECU mapping as the engine hardware.
If you use your existing ECU, you may see some improved power (those high lift cams and S8 specific injectors must do something
If you're expecting to swap the ECU as well, I hope you have some time!
Once you go past 2005, the 4.2 goes back to 4 valves but adds direct injection (FSI). I doubt your ECU could drive a FSI engine...