Police say detective stopped gang-related ‘hit’