David Moyes watched his new Sunderland side beat Rotherham as trialist Charles N'Zogbia scored the winner for the Black Cats.