That gun is going to haunt him. If he had just gotten rid of it i would say he could easily beat the case, but that gun that they say can be ballistically tied to the body is going to hang him.

How does he explain away the gun?

At the very least he's an accomplice to a homicide. And if they can prove it was a planned murder to get rid of a witness he's as guilty as the guy who pulled the trigger.