The decision overturns a prior unanimous ruling and comes after five new justices have been added to the court.