Help us deliver journalism that makes a difference in our community.

Thomas, a reserve defensive back thrust into action after an avalanche of injuries, intercepted Brady in the end zone Sunday, sealing the Dolphins’ pulsating 24-20 victory over the Patriots.

With the victory, the Dolphins improved to 8-6 and kept the pressure on the Baltimore Ravens for the AFC’s sixth and final playoff spot.

The Dolphins are playing their best football at the most important time. They’ve won four of five games and will be favored in their final two — next week in Buffalo and then in the finale against the New York Jets.

But just like their wild win over the Steelers the week before, this one was far from easy. They needed contributions from a rookie corner and a safety who is still a stranger in his own locker room.

Thomas and Will Davis had played a grand total of 13 NFL snaps — combined — entering Sunday’s game.

But injuries to starting corners Brent Grimes (who injured his groin, but should be fine) and Nolan Carroll (knee) forced both into action late in the game.

The Patriots, down four points with 1:15 to play, needed 80 yards on their final drive to win. In other words, they were right in Brady’s wheelhouse.

Passing the test

“He’s going to exploit any team’s weakness,” Thomas said. “If he sees a new guy or a guy went down, the next guy up, he’s going to see where they’re at. And I knew that I had a chance if I got in, he was going to do that to me.”

Thomas — claimed by the Dolphins off San Francisco’s practice squad Tuesday after both Dimitri Patterson and R.J. Stanford went on injured reserve — passed both tests.

First, Thomas ripped the ball out of Danny Amendola’s hands in the end zone.

Then, on fourth-and-5 from Miami’s 14, he read Brady’s eyes and drifted back from the slot corner position to make the game-clinching pick.

After that? Bedlam. Dolphins players swarmed their new teammate, who had never played in an NFL game before Sunday. Then, the tears came streaming down Thomas’ face.

“A lot of people are going to try to put their own term to it,” Thomas said. “ ‘Lucky,’ you know, ‘beastly.’ But I used the term ‘blessed.’ ”

Dolphins coach Joe Philbin must feel the same way. Usually, teams down to their third-string defensive back have no chance against Brady — particularly one who barely knows the calls.

But Thomas got special attention from assistants Lou Anarumo and Blue Adams throughout the week.

And yet, Thomas said the first time he worked with the Dolphins’ starting defense was during the game. All of his snaps in practice last week came on the scout team.

“I don’t know him that well,” Philbin said. “When you meet the guy, you like him. He’s a bright guy. He picks stuff up and when we needed him, he contributed.”

Hanging on

If not for Thomas’ heroics, the Dolphins defense might have again had to answer for yet another blown lead.

Ryan Tannehill, who outdueled Brady on this day, did more than enough to win. He had 312 passing yards and three touchdowns Sunday — the last coming on a 14-yard strike to Marcus Thigpen.

But the score came too soon.

Brady had plenty of time to rise from the dead again.

The range of emotions from the Dolphins’ sideline, which has seen five blown second-half leads this year?

Receiver Mike Wallace, who had 105 yards and a touchdown on six catches: “Honestly, I might die two years earlier after that.”

Tannehill: “That was the longest 75 seconds of my life.”

And offensive tackle Bryant McKinnie: “It was torture. The last two weeks have been like that. We were sitting there, and we didn’t want to look, then you do want to look. It’s too much. We have to get some games that aren’t so close.”

The Dolphins had no margin for error on Sunday, however, because the offense was so bad early. They went scoreless for the game’s first 29 minutes 28 seconds. Miami managed just 112 yards and no points through their first four possessions.

Heating up

Then, Tannehill got hot. Not surprisingly, it was in a hurry-up situation.

Late in the first half, Tannehill directed an eight-play scoring drive that covered 82 yards in just 66 seconds. Wallace did the heavy lifting.

He caught a post pass, broke a tackle and then raced 39 yards to the end zone to cut the lead to 10-7 at intermission.

The Dolphins would then score on their next two drives to take the lead, but New England, not surprisingly, wouldn’t go away.

Brady, who was 34 of 55 passing for 364 yards and two scores, was lights out for most of the second half. Amendola and Julian Edelman had 270 yards on 23 catches between them.

And when Brady connected with Edelman on a 24-yard touchdown pass with just over four minutes to play, it appeared he had foiled the Dolphins for an eighth straight time.