This will do what you want:
...but I see two potential problems:
1 - it uses up a firewire port
2 - it costs $39.99 USD...IMO you should be able to get equally good speakers with a regular connector for the same money. (I have and like the Apple Pro speakers, but I don't think they're worth the $100 or so they used to cost when bought separately, and for my money wouldn't be worth an extra outlay of ~$50 CDN. YMMV.)
I thought Griffin had a simpler and cheaper adapter, but it seems I'm mis-remembering. The hitch is that to use the Pro speakers with computers other than the iMacs and certain G4 towers, you need to add amplification of some kind (which can't be had from a regular audio-out port).
I'll let a G5 owner fill you in on just what the G5 has on-board audio-wise.