You first need to try to walk past the guards towards the scaffolding (left); the guard will call you back. Then if you speak to Anna-Marie you should be able to to talk to her about distracting the guard - she will walk over to the guard and start chatting. You then need to
walk towards the scaffold (not run) so that the guard doesn't notice you. It should work.
BUT before you can do this, you have to look at the map of Topkapi Palace and click on the Lover's Vestibule. Then you need to talk to the waiter about the Lover's Vestibule. This will allow you to leave Anna-marie to distract the guard, as she knows to meet you later at that Lover's vestibule door where you can let her in. If you don't do this she'll complain about being left behind and not distract the guard for you!
Hope this helps!