I don't think Minato knew who was behind the mask at the time, but since Kishi threw in the deus ex machina thingy, Minato was viewing the events through Naruto's eyes. I'm guessing he was able to deduce what organization the masked man was from. After all, Naruto saw Tobi during the rescue Sasuke arc Part II (and Tobi wears the cloud shape patterns on his cloak).
Kakashi was able to come to the conclusion that Uchiha Madara was behind the events, because Jiriaya obviously speculated it and told Kakashi.
So basically, Minato couldn't have known much, but since Minato can view the events after his death through Naruto's eyes, he must have worked out how Akatuski and this masked man relate to each other.