It's not and never is that simple. If the person is charged with a crime then the police and prosecutor believes there is sufficient evidence to prosecute. Possession can either be "actual possession" or "constructive possession." The first is where you actually have in your possession the item; the second is where you are aware of the item's presence and you have the ability to exercise control over it. An attorney will investigate and assess the circumstances and advise you what's best. Depending on the circumstances, you may have to defend the charges at a trial.
Knowledge of the drug is necessary to convict, therefore lack of knowledge is a defense to possession of a dangerous drug. The facts and circumstances surrounding this offense should be discussed with your lawyer to determine any available defenses.
It is best not to completely lose sight of practicalities. The prosecution is going to take this case to trial and require the witness to testify under oath that the drug was his/hers. Then, if the jury believes that testimony and acquits, they will arrest the witness and prosecute based upon that sworn testimony. If not, then they will have convicted the original defendant. Cops and prosecutors are not morons.
On the other hand, having this outcome explained by counsel, the witness may recant and take the 5th at trial, leaving the Defendant with no choice but to take the stand himself and testify that the drugs belonged to someone else--this is problematic and not only may the story not hold water but the fifth has not been waived by the defendant and he can be cross examined.
Plus, the jury is sitting there saying, well, one thing we know for sure is that the defendant had the drugs.
Good luck to you.