After banking a 3-pointer from the top of the key, Maryland men’s basketball guard Ja’Kobi Gillespie angled his head toward the Maryland bench, threw his arms up in disbelief and broke out into an uncontrollable grin.

His triple put the Terps up seven late in Wednesday’s clash with No. 17 Wisconsin. Despite Wisconsin cutting its deficit to one just under two minutes prior, Gillespie’s shot felt like the dagger in Maryland’s 76-68 win at Xfinity Center.

It marked the Terps’ fourth straight victory and the sixth in their last seven games. After starting conference play 1-3, coach Kevin Willard’s team moved fourth place in the 18-team Big Ten.

“I think the biggest thing was just getting through January,” Willard said. “I knew January was going to be hard with the two swing trips. So I think the biggest thing is we’re getting a nice week here, a bye week, and just get these guys refreshed mentally going into what you want to be a fun February.”

Maryland returned from a two-game road trip Wednesday for its annual “Gold Rush” game — a sold-out student section packed Xfinity Center in perhaps the loudest home game this season.

[Maryland men’s basketball notebook: Donation from a ‘dinner buddy,’ a ranked home game]

It also helped that Maryland (17-5, 7-4 Big Ten) entered on a three-game winning streak, with two of those coming on the road, and was likely playing for a spot in next week’s AP poll. The last time the Terps cracked the top 25 was February 2023.

But they didn’t look like that to start, missing 15 of their first 21 field goal attempts. Wisconsin shot 55 percent from the field in the first 12 minutes and took a 21-16 lead.

Julian Reese helped the Terps avoid a catastrophic start — he scored nine of their first 16 points, while the rest of the team shot 2-for-16 from the field. The senior big man picked up his second foul late in the second period, though, sending him to the bench for the last six minutes.

Maryland still closed out the half on a 16-8 run and, despite trailing for 15 minutes and shooting just 33 percent from the field, took a 32-31 lead into the break.

The Badgers opened the second half with more offensive firepower, making four of their first six shots to build up a six-point advantage. Wisconsin went on an 11-1 run before fifth-year guard Selton Miguel made a timely 3-pointer.

Both teams hit a rough patch from there — neither side made more than two field goals across the next four minutes.

[Maryland men’s basketball’s road woes halted in undefeated week]

But like Maryland’s offense has done many times this season, it pulled itself out of the rut in dramatic fashion.

The Terps put together a 14-2 run — off the backs of four 3-pointers — to open up a seven-point lead with seven minutes remaining. The fourth triple by sophomore guard Rodney Rice produced a deafening roar and forced a Wisconsin timeout.

“When it gets loud it’s definitely probably tough for the other team to get going in different parts of the game,” Rice said. “That crowd helps us out a lot.”

The Badgers clawed back again and were down just one with five minutes to go. Maryland reeled off four straight field goals to end the Badgers’ hopes for good.

Maryland won five of eight games in January despite playing the majority of its games on the road. With the Terps playing just two road bouts in February, they’re well-positioned to continue their hot streak across the ensuing month.

“Coming off the Washington and Oregon trip — I think we were 1-3 — they could have let a lot of negativity affect them,” Willard said. “Their attitude has been just phenomenal. I think that’s the biggest thing, is that they’ve been really resilient.”