The Air's superdrive won't work on the G5. The FW on your MBP is FW800, the iMacs is a FW400. You can get a firewire 9pin to 6pin adapter and boot your iMac G5 into target disc mode by holding down the T key at startup and using your install disc in your MBP.
You will not be able to use the MBP install media or are you using the CDs that came with your iMac?