Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Yes, the iMac late 2009 supports Target Display Mode

Cable Supported: Mini DisplayPort to Mini DisplayPort

Port on Source Computer: Mini DisplayPort or Thunderbolt

Thunderbolt ports are backwards compatible, meaning they support MiniDisplay Port cables. Your iMac 2009 with MiniDisplay Port does not support Thunderbolt. So you will need a Mini DisplayPort to Mini DisplayPort cable; this would then be plugged into Mini DisplayPort in 2009 iMac and Thunderbolt port in the Air.
 
Yes, the iMac late 2009 supports Target Display Mode

Cable Supported: Mini DisplayPort to Mini DisplayPort

Port on Source Computer: Mini DisplayPort or Thunderbolt

Thunderbolt ports are backwards compatible, meaning they support MiniDisplay Port cables. Your iMac 2009 with MiniDisplay Port does not support Thunderbolt. So you will need a Mini DisplayPort to Mini DisplayPort cable; this would then be plugged into Mini DisplayPort in 2009 iMac and Thunderbolt port in the Air.
That information is incorrect. The OP asked about a Late 2009 21.5-inch iMac. Only the 27-inch from that era supports Target Display mode (TDM). The 21.5-inch iMac did not support TDM until 2011, when the iMac included thunderbolt.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.