A California law set to take effect Jan. 1 that threatens the business model of ride-hailing firms is sparking fresh legal and political battles as Uber Technologies Inc. and Lyft Inc. pursue a campaign to revamp the legislation.

The so-called gig-economy law establishes a test that employers must pass to classify their workers as independent contractors, as Uber and Lyft do with their drivers. Employers who fail the test must treat the workers as employees entitled to benefits including minimum wage and paid sick days.

...