In my experience with the Windows XP CD that comes with Gateway systems, it's a standard WinXP OEM install CD that asks for the product key during installation (or at least with the pre-SP2 CDs... not sure about the newest CDs). So chances are, as long as your friend's computer still has the sticker on the case with the product key, the Windows CD that you have with your Gateway system should allow you to reinstall WinXP on his computer (provided that the key is for Home and the CD is for Home, or the key is for Pro and your CD is for Pro).
As for the drivers, if you and your friend have the same model of system, then your driver CD should work with his system. Otherwise, you'll have to find the drivers on Gateway's site for his system, and probably burn them to a CD or something to install them on his system.
JW