They almost certainly didn't know that he was the Batman (nor did they know that some bat-dressing hero even existed).
However, there is this conversation:
Bruce: You told me a child did it.
The prisoner: But no ordinary child. A child born in hell. Forged from suffering. Hardened by pain. Not a man from privilege.
So, the prisoner knows that Bruce comes "from privilege". They already know that Bane has a special interest in Bruce, and that he's from Gotham (given his interest in the events there and his references to "my city").
It is not clear if they know his name, but I don't see how would that add any info to what they already knew, since -- being where they were -- it is not likely that they've ever heard of Gotham, let alone Bruce Wayne, before he was put in the pit.