Using an iMac 27 inch (2009) as a monitor for a mac mini with Lion
You may have already figured this out, but yes. You can buy that cable or the Apple Thunderbolt cable which is backwards compatible with Mini DisplayPort. 

Good luck!