If it's the 3rd gen iPod (with touch buttons that glow orange), it needs a FireWire connection to work reliably. Are you connecting it to USB? It cannot draw power from USB, so it cannot recharge it's battery, which is why to does recharge from the power connection in your car and starts working again. So it's probably working normally.
Your iMac does have a FireWire 800 port, I believe. If you have the FireWire docking cable that came with those iPods, you can use an adapter like this to adapt the iMac's port for the older FireWire 400.
That will provide it with the proper (for that iPod model) data connection that also supplies power at the same time.
NOTE: My 3rd gen iPod works with the latest iTunes and Mac OS X 10.7.4.