The teams are matched up for a Wednesday night second-round game in the Atlantic Coast Conference tournament at New York.
Sixth-seeded Virginia (18-12) received a first-round bye, while 11th-seeded Louisville knocked off defending champion Georgia Tech 84-74 on Tuesday night.
It was just the second victory in 11 games since Mike Pegues became the interim coach for the Cardinals.
“We've been through a lot,” Louisville guard Jarrod West said. “This is a great opportunity to come together even more.”
Virginia won 71-61 at Louisville to close the regular season Saturday. The Cavaliers also topped the Cardinals 64-52 on Jan. 24 in what became the final game under Chris Mack before the coaching change.
Wednesday night's winner will meet third-seeded North Carolina on Thursday night in the quarterfinals.
The Cavaliers should be well-rested. Their only game since Feb. 26 came with the trip to Louisville (13-18).
“I feel we're going to just play the rest of the season just as hard as we can,” Virginia guard Reece Beekman said. “We're just going to leave everything out there.”
Virginia forward Jayden Gardner made the All-ACC third team and Beekman was picked for the All-ACC defensive team.
The Cavaliers have some experienced personnel, including senior Kody Stattmann, who matched his career high with 11 points at Louisville.
“We're going to continue to need that,” Virginia coach Tony Bennett said.
Stattmann provided an extra option to go with sophomore Kadin Shedrick's career-best 20 points.
“Just seeing his comfort level and maybe confidence grow, getting some points off the bench was good, and he attacked and he used his length,” Bennett said.
The outcome might have provided the Cavaliers with much-needed morale boost. They had gone two weeks without a victory, losing two in a row.
“Going into Brooklyn with the win gets our confidence a little bit higher, which we need,” Stattmann said.
Whatever happens, Virginia should be prepared for a tight game. The Cavaliers' past seven games have been decided by 10 points or fewer.
Virginia is hoping to repeat its success from the last time the tournament was held at Barclays Center. The Cavaliers won the 2018 edition, though they were the #1 seed for that tournament.
The Cavaliers might need to slow West, a transfer from Marshall who scored a season-high 20 points in his first ACC tournament game. He reached a double-figure scoring total for just the fourth time this season.
“I haven't shot it great this year, but I still got confidence in myself,” West said.
Pegues added of the victory, “Hopefully it gives us even more juice and confidence coming into (Wednesday) against a really good UVa team that's going to punch us in the mouth at some point.”
Virginia leads the series with Louisville 19-5, winning 13 of the past 14 meetings.