If you just want to install the applications from the iMac G5 system disc unto the iMac G3, give Pacifist a try (the link is in my previous post).
If you're trying to install Tiger from the iMac G5 system discs, you won't be able to. As Cory5412 stated, those discs included with the Macs only work with those model Macs. You could probably install them on a million iMac G5s, but on nothing other than the same model iMac G5. The same is going to be the case with your friend's disc if the disc is an OEM disc and it's not the same model Mac as yours.
If you're trying to install Tiger from the iMac G5 system discs, you won't be able to. As Cory5412 stated, those discs included with the Macs only work with those model Macs. You could probably install them on a million iMac G5s, but on nothing other than the same model iMac G5. The same is going to be the case with your friend's disc if the disc is an OEM disc and it's not the same model Mac as yours.