Generalizing Magnus' Characterization of Free Groups to Some Free Products