The cops would prosecute the crime they gave the external evidence for. In this case the shooting of the victim, because that came to their attention as a crime. Since they wouldn’t have interacted with the victim except that he got shot, the fact he had a gun on him can’t be used as evidence against him. Just like if they search your car for guns, they can’t seize your bank statements from the glovebox and use them as evidence for financial crimes.
I did this for a business number many years ago and it worked fine.