Depends on why it's not playing. A couple of things to try:
1. First, check that other DVDs play on your iMac (i.e., rule out a drive error).
2. Try playing it with VLC Player rather than QuickTime. VLC player is free, open source s/w and far more versatile than QT. You can get it here:
http://www.videolan.org/vlc/download-macosx.html
3. If it still doesn't play, try running it through Handbrake. You'll need to read the FAQs on the Handbrake page to get the hang of it, but it's not difficult. Handbrake is also free. You can get it here:
http://handbrake.fr/downloads.php