Katt Williams just won back custody of his 8-year-old adopted daughter -- after the girl's nanny allegedly lied to a judge to take her away from him ... this according to new legal docs.