The general principle is that the NCB arises from the policy, not the driver. So the policy owner accrues it. Of course the policy owner has also to be the main driver.
Presumably Direct Line offer this as a marketing incentive to grow more business and are happy to take the risk on the second named driver. Doubtful that such an arrangement is transferable between companies - you'd have to commit to one year with DL before considering a switch elsewhere.