In a win for workers, the California Supreme Court sided with a former Google Inc. executive who said management and co-workers derided him for his age before firing him because they felt he was no longer a “cultural fit” for the youthful company.

In a unanimous opinion published Thursday, the court held that applying the federal “stray remarks” doctrine in employment discrimination cases — which deems statements made outside of the company’s decision-making process to be irrelevant — might lead to an unfair result.