Irishman Gunning went off with an injured knee during Saturday's 3-1 win over Hearts and initial assessments have shown damaged cartilage that could require surgery.
McNamara said: "Gav came off last weekend and it now looks like we could miss him for the rest of the season.
"We still don't know the full extent but we will find out soon enough.
"It's disappointing because he has done well for us. Especially at this stage, with cup games and the last bit of the league to go."
McNamara will most likely turn to Brian McLean at the heart of his defence against leaders Celtic this weekend, adding: "Brian did very well when he came on against Hearts so we will see what we are going to do."