Virginia guard Devon Hall grabs a rebound as Louisville guard Donovan Mitchell loses his footing during the Cavaliers’ 71-55 win in Charlottesville. (Steve Helber/Associated Press)

With the Virginia men’s basketball team in the midst of a brutal five-game stretch that will include a game at No. 8 North Carolina and a game against No. 18 Duke, No. 4 Louisville, of all teams, turned out to be the Cavaliers’ welcome reprieve Monday night.

The odds were stacked in Virginia’s favor before tip-off of its 71-55 win, which acted as a balm after an ego-bruising loss at Syracuse on Saturday.

The Cardinals had both immediate concerns and history to overcome: Louisville was playing without two of its three best scorers and was also down a starting center. They had come in with three straight losses to Virginia and hadn’t so much as led in a game against the Cavaliers since March 2015. They had come to John Paul Jones Arena ranked fourth in the country — Virginia’s highest-ranked opponent since a loss against No. 4 Duke on Jan. 31, 2015 — and yet Cardinals Coach Rick Pitino knew danger lurked in Charlottesville. He had dubbed the Cavaliers his team’s kryptonite after their first meeting this season, a 61-53 Louisville loss at home.

No. 12 Virginia (18-5, 8-3 ACC) lived up to its billing, earning its first win over a top-five team since March 1, 2014, against No. 4 Syracuse. The Cavaliers rode a 22-5 run at the start of the second half to victory and moved up a slot in the ACC standings. Virginia is now tied for second place with Florida State, and the Cardinals (19-5, 7-4) fell into sole possession of fourth.

“We’ve played some of our best basketball against them, for whatever reason,” Virginia Coach Tony Bennett said. “. . . [Pitino] is obviously a Hall of Famer. And he’s got terrific players, and I think our guys really know they have to be right to compete with Louisville.”

Virginia started out with more wrong than right Monday, as sloppy ballhandling (seven turnovers) and porous defense (18 points allowed in the paint) led to a two-point deficit at halftime. Then senior point guard London Perrantes set the tone for Virginia’s decisive run by starting the second half with a three-pointer. He held his hand in the air afterward and asked the raucous crowd for more noise.

They obliged, and Perrantes responded in kind. The point guard turned in a team-high 18 points on 5-for-12 shooting and two three-pointers. Forward Isaiah Wilkins, increasingly Perrantes’ counterpart as a leader on the defensive end, led all players with 11 rebounds to go with 13 points and five blocks to establish a tighter second-half defense. It was his first career double-double.

“He willed us. He knew we needed to respond to the challenge of stopping the ball collectively,” Bennett said of Wilkins. “It’s not about one guy. Our defense has been good for us and we’ve gotten gashed a few times in some games and we really said, ‘Let’s rally.’ He was the leader of that rally of bringing us together and just demanding a better team defensive approach.”

Louisville shot 46.7 percent in the first half compared to 37 percent from the field in the second. Virginia, meanwhile, shot 53 percent from the field and held Louisville to just four points in the paint after halftime.

Freshman forward V.J. King led the Cardinals with 24 points on 8-for-14 shooting, and sophomore guard Donovan Mitchell had 16 points. The youngsters carried Louisville, which played without three of its best players Monday. Junior guard Quentin Snider, the team’s second-leading scorer, has missed time with a strained hip flexor, and starting forward Deng Adel and starting center Mangok Mathiang were suspended for Monday’s game after breaking curfew Saturday night following a win at Boston College.

“It’s kind of a bummer for us, because we kind of want to play teams when they’re at their best,” Perrantes said. “They were kind of hot coming in. We knew they had some injuries, but they were still playing extremely well with the two guys that weren’t in tonight. We’ve just got to play whoever’s in front of us.”

A Sunday evening game at Virginia Tech lies directly ahead of the Cavaliers now, following a reprieve almost as sweet as a win against Louisville: five full days of rest.

“I’m excited to sleep,” Wilkins said. “I’m going to take a lot of naps, take these days off seriously, rest my body and then get ready to come play. I’m sure everybody else will too.”