Can my Thunderbolt Macbook Air drive my Mini DisplayPort iMac as an external display?
According to this source, this should work. This other source confirms it. These are the troubleshooting steps I would try:


Run all software updates on both the iMac and MacBook Air. A lot of times there are firmware updates that address issues like this.
Open System Preferences > Displays and click Detect Displays.
Reset the PRAM on both the iMac and the MacBook Air by restarting the computer and holding &#x2318;+&#x2325;+P+R on boot but until you hear the POST chime twice. Then you can let go and boot normally. Be sure to do this on both machines.


Try going through these steps and let me know if you're able to resolve the issue.