You can use the KVH Autocomp as proposed by Jim if you don't plan to use the NMEA-183 input for something else. HDS-5 only has one NMEA-183 port.
I have a Maretron SSC-200 connected to my NMEA-2000 network, originally installed as radar heading sensor for E80, the heading info are of course also showing up nicely at my newly installed HDS-5.
http://www.boemarine.com/Products/MA...1/Default.aspx
SSC-200 has a built-in rate gyro so it's able to give better quality heading info than KVH Autocomp in rough seas. The only disadvantage is a bit cumbersome calbration without a Maretron display. For calibration I had to connect the compass to the serial port af a laptop, and then sendig commands using Hyperterminal.