The leader of the alleged upstate cult Nxivm pleaded not guilty in Brooklyn federal court Friday to charges that he kept women as sex slaves and branded them like cattle — while his accused cohort, “Smallville” actress Allison Mack, tried to wriggle out of attending their next hearing.

Keith Raniere appeared in the courtroom with graying shoulder-length hair and a freshly shaven face as he stood alongside Mack, his co-defendant and alleged “slave master.”

His lawyer, Marc Agnifilo, told Judge Nicholas Garaufis that his client pleaded not guilty to the charges of sex trafficking, sex-trafficking conspiracy and forced-labor conspiracy.