I doubt your son is afraid of his grandmother. He is afraid of her appearance and the reality that she is very sick and dying. Even if you haven't told him that she's dying, at 5, he's bound to have heard people talking. I suggest that you be honest with him and explain in a very simple way what is happening to her. Allow him to ask questions. If he doesn't ask, you ask for him. For example: "I wonder if you're worried about Grandma?" That might be a good way to start this conversation.
Share pieces of information with him over several days. Stop when you can sense that he's not ready to hear more. He can't absorb it all at once.
I would directly ask him if he's worried that Grandma will die. I'm only 67 and in good health but my grandchildren have asked me about dying for several years now. They started around the age of 4. We talk about death in general, what to expect, and I emphasize that I am not dying anytime soon and that I will always be with them. You can't say she won't die soon but you can reassure him that she will always be with him, in his heart.
I'd also talk about his memories of her and about her and how she is still the same grandma even tho she looks different and isn't able to do all of the same things. Plan and suggest things that the two can do together. Are there any table games that they could both enjoy? My grandkids like "go, fish." Could they watch kids TV or DVDs together? Could he build something for her with his Legos or blocks?
Starting out with him drawing her pictures, as someone else suggested, for his grandma or even for you might be helpful You can gain insight from what he draws, how he draws it, and what colors he uses.
Is there a place in her room for your son to sit? Perhaps help him choose a special place that's his in the room. Keep some of his toys there.
If you think now is the time to deal with dying there are many good books written for children that you can get from the library. I don't remember names except for one entitled Freddy the Leaf. Another one was about a grandfather and child and how they spent time together before he died. Read them with him.
Once the "elephant in the living room" is out in the open he will probably be more able to spend time with his grandmother. The "elephant" being her illness and process of dying.
I also agree that Hospice may have some helpful suggestions.
And added thought. Because she's recently moved in your household has changed. He may be unconsciously angry that she takes time away from him or because everything is so different. He may just be mostly confused and need time to adjust to this new way of doing things. Include him as much as possible in your time with grandma. Let him go into the room with you some of the time. Don't try to involve him. Just let him be the way he wants to be. He may be feeling overwhelmed and his way of dealing with it is to withdraw.
I'm assuming that she doesn't come into the rest of the house and is unable to participate in ordinary daily activities. This would've caused me, as a child, to be anxious and I would have withdrawn. As I'm thinking about this an anxious feeling is coming to the surface. I know I was anxious about major changes in my child hood home and my reaction was always to withdraw and be very quiet and unwilling to do things.