Brady throws late TD as Patriots top Cowboys 20-16