It’s been 40 years since the Yankees famously chased down the Red Sox to capture the AL East crown, turning a 7 ½-game deficit on Aug. 27 of that season into a division title in Game 163.

This year, they have a little less than five weeks to see if they can get to Boston, a notion that seemed preposterous just a week ago, when the Red Sox led the division by 10 ½ games.

Since then, the Yankees finally took advantage of a schedule filled with teams that have already surrendered the season — namely, the Orioles — and the Red Sox finally stumbled against the Indians and Rays.

In the last week, Boston endured a pair of three-game losing streaks, while the Yankees won four straight and eight of nine overall until Monday’s ugly 6-2 defeat to the White Sox knocked them back to 6 ½ games out. Their next challenge will be closing the gap entirely. Here’s how the teams look the rest of the way:

Schedule

Beginning Tuesday, the Yankees will have 31 games remaining in the regular season — one more than the Red Sox, who were off Monday. Boston’s opponents are split evenly between teams with winning and losing records, while the Yankees will have 16 games versus teams over .500 and 15 versus teams under .500. The Red Sox will play 17 games at Fenway Park, as opposed to 13 on the road and the Yankees have 15 at home and 16 away from Yankee Stadium.

The Yankees will face perhaps the most daunting task, since in addition to having to make up ground, they head out on a nine-game trip following this homestand — including six games against Oakland and Seattle — both of whom are in the playoff hunt.

Boston, meanwhile, has three games apiece against division-leaders Cleveland and Houston.

Most interesting, though, will be the six games when the Yankees and Red Sox face each other — including the final three games of the season at Fenway Park. Time will tell just how important that last matchup will be.

Health

Aaron Boone’s pregame press conferences have become filled with injury updates — often vague ones. The Yankees are optimistic Didi Gregorius (bruised left heel) and Gary Sanchez (strained groin) will be back in the lineup soon. The same can’t quite be said of Aaron Judge’s chip fracture in his right wrist. What was initially called a three-week injury is already on its fifth week — and Judge has yet to even swing a bat.

Boone continues to says Judge is making progress and will return to full strength “soon,” but at this point, there is no telling when that will be.

Aroldis Chapman has been bothered by left knee tendinitis for much of the season. The injury worsened last week and the closer is still just resting the knee after receiving a PRP injection. The bullpen is built to withstand a loss like Chapman’s for a short period, but a prolonged absence would no doubt tax one of the team’s strengths.

The biggest red flag for Boston is Chris Sale’s left shoulder. He has been sidelined twice with inflammation in the spot this season and remains on the DL, but he began a throwing program on Monday, according to reports. Christian Vazquez (hand), Rafael Devers (hamstring) and Eduardo Rodriguez (ankle) are all expected back soon.

Etcetera

If the Yankees are to duplicate their ’78 comeback, they’ll need more than a few things to go their way. In addition to feasting on lesser competition — something they’ve had difficulty with during parts of the season, but have done a better job with recently — their long list of injured impact players have to get back on the field and be productive.

At this point, there are questions about just how much they’ll be able to expect from Judge and Chapman, as well as Sanchez, who has not approached his previous numbers even when he’s played. It’s a daunting task, but one that, while not likely, seems at least possible now.