New York’s top financial regulator is going to allow life insurers to use data from social media and other nontraditional sources when setting premium rates, though the insurers will have to prove the information doesn’t unfairly discriminate against certain customers.

New York is the first state to set specific guidance governing how life insurers use algorithms to comb through everything from homeownership records to credit scores and internet use in an effort to size up an applicant’s risk. At least a couple dozen insurers...