Whether you use double or single quotes, if you are using a Bourne-like shell, gawk will see the program exactly as it appears between the quotes. Even in double quotes, both Bourne and csh-like shells only consume \ before characters that might need escaping (like $, and in the case of csh, ! - thus in csh this program would appear syntactically correct to gawk, though it still wouldn't do what you want).
! has no meaning to gawk in this context, so it gives an error. To "output lines with number of fields different than 6 and ending with backslash", use:
gawk 'NF != 6 && /\\$/' file
That is: match lines that don't have 6 fields, and which match \ immediately preceding end of line ($). The \ must be escaped with another backslash, because gawk too uses \ for escaping - though in the case of gawk, all \ (except those escaped by another \) are absorbed; those that don't escape a special character are simply elided.
With no associated action, the default action (print the line) will be taken when this conditional statement is satisfied.