The Scots had trailed 17-0 at the interval but pulled level in the second half before the All Blacks sneaked a win.