It is best to have the original DVD set or at the least, a Retail Upgrade Disc when selling an iMac.
Because I'm not sure exactlly which model iMac you have, it's hard to say exactly what OS X Upgrade Disc version you can use.
If the iMac is an Intel Core 2 Duo between 2007 and 2010 then Lion from the App Store will work
If the iMac is an Intel Core Duo or Core 2 Duo between Early 2006 and 2009 then a retail Snow Leopard Upgrade Disc will work.
If the iMac has a PowerPC processor, then you will need to either call Apple or hunt around for a retail Tiger or Leopard Upgrade Disc.
Better yet, contact Apple and request a replacement Disc set for that iMac.