Lennon had all but written off the former Aberdeen player's chances of facing Hearts at Hampden earlier in the week but the centre-back has joined Jim Goodwin in shaking off injury just at the right time.
Lennon said: "Lee Mair has made a fantastic recovery, like Lazarus.
"We had him away to a specialist and we got good information so he quickly joined us on Tuesday evening up at St Andrews and he came through training fine.
"So fingers-crossed, that's a welcome bonus for us. I'm delighted for the player as well and hopefully he can come through it."
Mair could be joined by Estonian winger Sander Puri in the cup final squad with Lennon set to have talks with the trialist.
"Sander Puri came away with us and he's a player we are certainly looking to tie up," Lennon said.
"We have a meeting with his representatives and hopefully that can be tied up before Sunday.
"If the deal is done it would then give me another decision to make and if I felt he could give us a helping hand then I would use him."
- Sports & Recreation
- Lee Mair