The night king can raise things from the dead. The night king can ride a dragon because he rose it from the dead. He can control the white walkers he can raise the dragon from from the dead and control it, it’s doesn’t make him a TargaryenOnly Targaryen's can ride dragons + the Night King rode a dragon = the Night King is Targaryen.
Math