I found another way of doing this and it does not require any additional cables. It can be done wirelessly and with our downloading any (non Apple) software. And yes, I've done this using a Mid 2010 21.5 inch iMac which alegedly does not support scree sharing. So, here is how to do it.
- You need an AppleTV
- Search for Screen Sharing on your old Mac which you want to use as the extended display (Screen Sharing Version 1.7.2) and launch it
- Go not your newer iMac and select "Displays" from Systems Preference. At the bottom select your AppleTV from your Air Display menu and tick "Show mirroring option in the menu bar when available)
- Go back to your old Mac and from the Screen Sharing software option click on the option with the arrows pointing out under Scaling (it's on the left) and on the drop down menu from Displays select (Display 2: 1680 x 1050). You might need to point the mouse to the top to the old Mac's screen for the Screen Sharing software options to re-appear as they disappear after a while.
Follow these instruction and you'll be all with wireless screen sharing.
This is a good way to extend the life of your old iMac which otherwise would probably either end up recycled or left in the loft doing noting.
I hope this will work as well for you as it does for me :-)
ps. the only issue is that this does not cover the total surface of the screen. There is a little bit of screen lost but not too much.