FOXBOROUGH, Mass. -- Down three points. Barely two minutes left. One thought on Tom Brady's mind.

"You can't not get the ball in the end zone," the master of late comebacks said.

That's where he got it, throwing an 8-yard touchdown pass to Aaron Hernandez with 22 seconds left and giving the New England Patriots a 20-16 win over the Dallas Cowboys on Sunday.

"He's probably one of the toughest competitors I've ever seen, especially from a quarterback standpoint," Patriots defensive tackle Vince Wilfork said. "There was plenty of time for our offense.

"When it mattered the most, they came up with what we needed."

It was the 32nd successful comeback of Brady's career in games the Patriots trailed or were tied in the fourth quarter. And it came against a solid defense -- ranked fourth in the NFL -- that had allowed just one touchdown on the Patriots' first nine possessions.

"When you're playing against a quarterback like Tom Brady, he's going to go down as one of the all-time greats," Cowboys coach Jason Garrett said. "So you have to try to make it hard on him."

Dallas, coming off a bye week, did that for most of the day, sacking him three times and intercepting two passes. But on the final 80-yard drive that started with 2:31 left, Brady completed eight of nine passes for 78 yards.

"We prepare hard for that situation every week and when it came up this week, it's good to get the ball in the end zone," Brady said. "I'd prefer to be up four touchdowns with two minutes left, but it just wasn't the case."

New England (5-1) won despite its first two lost fumbles of the season. Brady finished the game 27 of 41 for 289 yards with two touchdowns.

Dallas (2-3) ended a five-game road winning streak after a bye despite coming back from a 13-3 deficit midway through the second quarter.