Detective tells court how he helped witness oust gangsters