The Ottomans called that one "Kuçuk Ayasofya", or Little Hagia Sophia. It was a Byzantine church initially, built sometime around 500, and many believe it served as an early prototype for the larger Hagia Sophia cathedral built a few decades later.
But I have my doubts. The two buildings may share some salient aesthetic features, but their structural elements are vastly different. It's obvious, right? I mean, if you bother to look closely.