The G5 iMacs used desktop ram so it will physically fit.
But installing the slower memory into the iMac which requires the 400mhz won't work. Unless you worded that wrong, PC3200 400mhz will work in a PC2700 333mhz machine as the memory will automatically downclock itself to the slower speeds.