As others have said, neither the analog nor the optical output on the G5 uses a proprietary cable. You can use either a 3.5mm stereo plug for analog output or a mini-Toslink to Toslink for digital.
If your question is which one is preferable, it's likely that the digital to analog converter in your receiver is better than the one in your iMac so that's likely your best option. The cables are inexpensive, though, and it would be easy to compare. A good source for well-made cables at great prices is monoprice.com.
If your question is which one is preferable, it's likely that the digital to analog converter in your receiver is better than the one in your iMac so that's likely your best option. The cables are inexpensive, though, and it would be easy to compare. A good source for well-made cables at great prices is monoprice.com.