In the film Faramir stays behind with Eowyn. After everything Aragorn and Theoden have done for Gondor I wonder is there any dialogue in the book explaining why he did not join for the final battle before the Black Gate?
Because he's still recovering from his injury and his fever (the one that made Denethor think he was dead):
Aragorn and Gandalf went now to the Warden of the Houses of Healing, and they counselled him that Faramir and Éowyn should remain there and still be tended with care for many days.
Return of the King Book V Chapter 8: "The Houses of Healing"
This scene takes place very shortly before (in all likelihood, earlier in the same day as) the decision to march on Mordor; a later chapter, set shortly after the armies leave Minas Tirith, indicates that Faramir is still there:
When the Captains were but two days gone, the Lady Éowyn bade the women who tended her to bring her raiment, and she would not be gainsaid, but rose; and when they had clothed her and set her arm in a sling of linen, she went to the Warden of the Houses of Healing.
At a sign from Faramir, the Warden bowed and departed. 'What would you have me do, lady?' said Faramir. 'I also am a prisoner of the healers.' He looked at her, and being a man whom pity deeply stirred, it seemed to him that her loveliness amid her grief would pierce his heart. And she looked at him and saw the grave tenderness in his eyes, and yet knew, for she was bred among men of war, that here was one whom no Rider of the Mark would outmatch in battle.
'What do you wish?' he said again. 'If it lies in my power, I will do it.'
'I would have you command this Warden, and bid him let me go,' she said; but though her words were still proud, her heart faltered, and for the first time she doubted herself. She guessed that this tall man, both stern and gentle, might think her merely wayward, like a child that has not the firmness of mind to go on with a dull task to the end.
'I myself am in the Warden’s keeping,' answered Faramir.
Return of the King Book VI Chapter 5: "The Steward and the King"
The Extended Edition of the film includes a scene between Faramir and Éowyn, indicating that he remained behind in the Houses of Healing:
Éowyn: The city has fallen silent. There is no warmth left in the sun. It grows cold.
Faramir: It's just the damp before the first spring rain. I do not believe this darkness will endure.
Return of the King (2003)
This scene occurs immediately after the Captains of the West are shown to be riding from Minas Tirith.