It’s not easy, or cheap, to fight the government. But companies facing regulatory heat over their use of independent contractors may improve their odds by taking the matter to court—especially if the cost of replacing contractors with regular employees would drive them out of business.

For example, a Texas oil-field services company’s aggressive defense in the face of a Labor Department audit ended up paying off last month, when a federal judge sided with the company and dismissed the agency’s enforcement action.

“Anyone who has faced a Labor Department audit… can look at this and see a path for challenging the department,” said Josh Alloy, special labor and employment counsel for law firm Proskauer Rose LLP. “Any time a $6 million assessment by DOL is overturned, that’s a big deal for employers.”

Gate Guard Services L.P. hires contractors to serve as gate attendants at energy extraction and construction sites. The company sued the Labor Department in 2010, after the agency told Gate Guard it owed the workers more than $6 million in back pay and ordered the firm to reclassify them as employees.

“It would have been a big blow to the company,” said Gate Guard founder and chairman Bert Steindorf. He said the agency wanted him to pay the attendants, who log traffic at the sites but have long stretches of free time, as if they were working 24-hour shifts, seven days a week.

A Labor Department spokeswoman said the agency is reviewing the Gate Guard ruling and “evaluating options for moving forward.”