FOXBOROUGH, Mass. — This is no time for the New England Patriots to get discouraged.

Not with a rare two-game losing streak and a critical game coming up against the surging New York Jets. Not with a chance to break a tie with their rivals for first place in the AFC East.

“We’ve just got to continue to believe in what we’re doing,” defensive tackle Vince Wilfork said Thursday.

The defense is doing better — at least it did in last Sunday’s 24-20 loss to the New York Giants — but still has allowed the most yards per game in the NFL. The offense is sputtering, with three straight games of 20 points or less after five in a row of 30 or more.

The defense held the Giants scoreless for the first half, and the Patriots went ahead on a touchdown with 1:36 left. But New York marched right down the field and won on a TD pass with 15 seconds remaining.

“It’s not always going to be perfect,” Wilfork said, “but when it’s not perfect, what are you going to do? Will you be mentally tough and handle the situation or will you just fold and just give into the critics and give into everyone who says we can’t do it? So I have faith in this team. I really do.”

The Patriots have lost consecutive games for just the third time in nine years.

In 2006, they went 6-1 after that losing streak, finished 12-4 and lost the AFC championship game to the Indianapolis Colts. In 2009, the two-game slide dropped them to 7-5 but they clinched a playoff berth by winning their next three games before losing their only postseason game to the Baltimore Ravens.

The Jets lost to the Patriots 30-21 in their first matchup this season, but haven’t lost since, a three-game roll that has them tied for the division lead with New England and the Buffalo Bills at 5-3.

“They turned it around,” Wilfork said. “They started playing better football. So they got it together. Now the tide has turned. It says a lot about your team if you can stick together and play together, play good football.”

The Patriots have been close in all three losses, with margins of three, eight and four points. One loss came on the final play. Another was decided on a touchdown in the final minute.

“You have a bunch of guys that fight,” Wilfork said. “You don’t have anyone that’s out there giving up. That says a lot to a football team.”

Still, some doubt can creep in when a team has lost two straight and needed a last-minute touchdown to win the previous one, 20-16 over the Dallas Cowboys.

“When things don’t go your way for a couple of weeks or so, you always start questioning,” running back Kevin Faulk said, “That’s just human nature. But, at the same time, you’ve got to get back to what you were doing.”

The Patriots have allowed their four fewest yardage totals of the season in each of their last four games, starting with a season-low yield of 255 against the Jets. But now the defense is battling injuries.

End Mike Wright and safety Josh Barrett are on injured reserve. Two of their best defenders, safety Patrick Chung and linebacker Brandon Spikes, were hurt against the Giants and didn’t practice Wednesday and Thursday. Star linebacker Jerod Mayo is subpar with knee problems that kept him out of two games before he returned for the last two.

And the Jets’ offense is rolling.

Since struggling against the Patriots, they’ve improved, especially in the running game with ground totals of 104, 162 and 126 yards in their three victories.

“They’ve really gotten their running game going,” said safety James Ihedigbo, a former Jet. “Shonn Greene’s a great downhill runner, is running great with a lot of power, finishing his runs, and that kind of sets up everything else they want to do on offense.”

The Patriots haven’t been particularly strong against the run, allowing more than 100 yards in six of their eight games.

“You’re always going to face adversity during the season,” Ihedigbo said. “Losing two games in a row is not what you plan for, but when it happens you’ve got to just look at the mistakes that you made and continue to press forward because if you continue to dwell on it, then two can turn to four quick.”

That’s something the Patriots can’t afford in a tight division race.

“We’ve just got to work a little harder, especially now,” Wilfork said. “You’re in the middle of the season and we have 10, 11 teams in the AFC with (similar) records. So nothing is decided now.”