Yes, you need comprehensive car insurance to buy GAP insurance.
Because GAP insurance bridges the ‘gap’ between your car’s market value and the price you paid for it, if your car is written off or stolen, there has to be a car insurance payout for you to make a GAP insurance claim.