Here's my MacBook: http://www.everymac.com/systems/apple/macbook_pro/specs/macbook-pro-core-2-duo-2.53-aluminum-13-mid-2009-sd-firewire-800-unibody-specs.html
Here's the iMac: http://www.everymac.com/systems/apple/imac/specs/imac-core-i5-3.2-27-inch-aluminum-late-2012-specs.html
Basically, my MBP has one Mini DisplayPort and the iMac has multiple thunderbolt ports. These two are the same shape.
Is there an adapter or chord I can use to connect these two so that my MacBook uses the iMac as a secondary monitor?