I just tried the same thing using a Thunderbolt to Thunderbolt cable, which the "tech" at the local store told me would work. After reading online, I figured out how to share screens. However, the 27" imac will only show my 13" MacBook Pro as a 13" screen. It doesn't fit to screen on the 27", so it does my photo edits no better than my MacBook Pro. Here is the link on how I got my two synced. It isn't exactly the way this article describes, but it is close enough to figure out on your own I hope.
I hope this helps you!