I think Minato acknowledged that man screaming in pain (Obito) was the same Masked Man that attacked Konoha 16 years ago. Not sure how; perhaps he recognised the voice or saw him use Kamui?
He didn't realize it was actually Obito until he teleported infront of him.
Minato realized that obito was the one who was bringing madara back to life, he understands that in order to stop madara he had to kill obito. However he didnt know that it was obito until he killed him
Actually Minato once tagged Obito with the hiraishin mark during the time when kyuubi attacked konoha. And the hiraishin mark was still on obito, Minato sensed that and understood that the masked man he fought back then was obito. And so he did'nt have to mark him again and teleported towards him. But he only came to knoe it was obito, when he addressed him as 'sensei'. And that shocked minato.
:-D