I would tell him now. My oldest son's father was also completely out of the picture but I always knew that if he died and I found out before the funeral, that I would make every effort to bring him if possible and if he wanted to go. That way when he's older, he'll know that he said good-bye. Even if he wasn't an important part of your son's life, this guy did make up half of who your son is. That isn't important to him at age 5, but it will be important to him as he gets older and understands and reflects on who he is, etc.
I would also tell him, if he doesn't already know, about his half siblings. My son also has half siblings on his dad's side, one of whom lives near us. He has had no desire to meet him (my son is 20 and this half-brother is 22), but he knows. Your son won't really understand or process that part, but it will be something that he grows up knowing and not a big deal secret that gets revealed to him later. You don't have to harp on the absent part of his family, especially as you're building a new family, but you don't ever want him to think that you hid anything from him or that there is any secrecy or shame about this.
If there will be an opportunity for privacy, perhaps you can reach out to whomever is planning things to see if you can bring your son to the funeral home when there isn't a crowd there. I'm Catholic and am most familiar with Catholic traditions. Based on that experience, I know that before the wake starts, or at the funeral home before the body is transported to the church for the Mass, there are times when just a few close family members are around. That might be a good time for you to bring your son so that he can say a prayer or whatever is appropriate for your traditions and beliefs. At this age, if there is a mass and graveside service and all that, I don't think that would hold much meaning for your son and can be skipped.
Another option could be that if he'll be buried in a cemetery, that you skip the funeral events but bring some flowers and maybe have your son draw a picture or something that you can bring to the grave and leave behind.
Talk to your son and take your cues from him. If this is the first person close to him who has died, you might have to also get into an explanation of death and dying. It can be a lot for a little guy, but for something this important, he should know. And unless he strongly opposes going to the funeral or grave, I would give him the opportunity to have a final good-bye.