When Faramir wakes, he says this:
Suddenly Faramir stirred, and he opened his eyes, and he looked on Aragorn who bent over him; and a light of knowledge and love was kindled in his eyes, and he spoke softly. 'My lord, you called me. I come. What does the king command?'
'Walk no more in the shadows, but awake!' said Aragorn. 'You are weary. Rest a while, and take food, and be ready when I return.'
'I will, lord,' said Faramir. 'For who would lie idle when the king has returned?'
The Lord of the Rings: The Return of the King - Book V; Chapter VIII; The Houses of Healing
How did Faramir know that Aragorn was the King?
He had never seen Aragorn before! When Aragorn arrived via the Corsairs to the Battle of the Pelannor Fields in Year 3018, Faramir was still in his feverish state and unconscious.
Even as the Nazgûl had swerved aside from the onset of the White Rider, there came flying a deadly dart, and Faramir, as he held at bay a mounted champion of Harad, had fallen to the earth.
The Lord of the Rings: The Return of the King - Book V; Chapter IV; The Siege of Gondor
During all this black day Faramir lay upon his bed in the chamber of the White Tower, wandering in a desperate fever; dying someone said, and soon 'dying' all men were saying upon the walls and in the streets.
The Lord of the Rings: The Return of the King - Book V; Chapter IV; The Siege of Gondor
Therefore from March 13 onwards till March 15 (evening), Faramir is in his coma-like state. Aragorn arrives to Minas Tirith on March 15 (midday), therefore Faramir could not have seen Aragorn before.
Also, from the Years of 2951 to 2981 of the Third Age, Aragorn embarks on his journey in the Wild. Sometime during this 30 years he serves in the army of Gondor and hence arrives at Minas Tirith. Faramir wasn't born then (2983), so it would have been impossible for him to have seen Thorongil (Aragorn).
It is possible that:
- Faramir learns of Aragorn through Denethor?
We know of course, that Denethor was aware that one of 'high honor' was coming to his city, and from his speech with Pippin it is possible that he perceived who this person was.
'Still the Lord of Gondor learned more of you than you may have guessed, Pippin. You could not hide the fact that Boromir did not lead the Company from Moria, and that there was one among you of high honour who was coming to Minas Tirith.'
The Lord of the Rings: The Return of the King - Book V; Chapter I; Minas Tirith