Hi, and welcome to Apple Discussions.
Nope. You can't use the discs from the iMac.
It is important to have compatible restore CD's, obviously. It would probably be best to have the serial number handy and
call Apple at the Legacy number. Ask if they have the software restore and install discs for your model. If they do, they will send it to you for a fee.
Once you get the correct software, you can erase the hard drive and restore the original software by following the links to the proper Apple Knowledge Base article from this link:
http://docs.info.apple.com/article.html?artnum=61802
Good luck.