PISCATAWAY, N.J. — Tuesday’s tilt against Rutgers provided the Maryland men’s basketball team with an opportunity to recover from its recent funk. The Terps entered the contest having dropped five of their past seven games, but the Scarlet Knights’ woes spanned the entire Big Ten season. At 2-14, they were last in the conference standings.

That didn’t stop the Scarlet Knights from keeping pace in the first half, aided by Maryland’s foul trouble and poor post defense. Coach Mark Turgeon crossed his arms, threw up his hands and let out roars of frustrations before his team entered halftime up by four.

But as Maryland pulled away after the break, starting with a 17-6 run to open the period, Turgeon began to relax. The Terps found their three-point stroke, and forward Damonte Dodd dominated both ends to help seal a 79-59 win at the Louis Brown Athletic Center.

Maryland will have a chance to secure a top-four seed and a double bye in next week’s Big Ten tournament when it hosts Michigan State in the regular-season finale Saturday.

“Coming off a [three-game] losing streak, we were extra focused and we just wanted to bounce back,” guard Melo Trimble said. “So, our preparation for this game and the time before the game, we were really dialed in.”

The Terps’ defensive struggles that resulted in consecutive home losses to Minnesota and Iowa disappeared against Rutgers, which shot 41 percent from the field. Maryland made 54 percent of its attempts. Guard Melo Trimble led with 11 points, one of seven players to score at least eight on the night. The Terps’ bench outscored the Scarlet Knights’, 36-14.

Guard Anthony Cowan and forward Ivan Bender kept Maryland (23-7, 11-6 Big Ten) ahead early, while Dodd and guard Kevin Huerter, who combined to score 17 second-half points, headlined the late push. All 10 Terps who saw the floor scored, which included a three points in 11 minutes from injury-plagued guard Dion Wiley.

“I could talk about this guy or that guy, but I thought all 10 guys really played well,” Turgeon said. “We needed it, and I was proud of my team.”

The Terps couldn’t capitalize on that depth in the first half, as four players drew two personals. Forward L.G. Gill (10 points) was the first player to sit, picking up his second foul about eight minutes in. His teammates soon joined him. With about five minutes to play, Huerter, Dodd and forward Justin Jackson also had two.

With three starters playing limited roles, Maryland relied on its starting backcourt and a reserve big man for production.

Cowan paced the Terps with nine first-frame points, Trimble added six and Ivan Bender manned the frontcourt given his teammates’ foul trouble and forward Michal Cekovsky’s absence with a fractured left ankle. Bender played 14 minutes and thrived in the expanded role, scoring six points.

In the first half’s waning moments, he delivered an interior touch pass to Gill, who threw down a thunderous dunk to ignite the hoard of Maryland fans in attendance. But behind forwards C.J. Gettys and DeShawn Freeman, who combined for 23 points, Rutgers (13-17, 2-15) entered the half down just four.

“We have four keys to every game, and our first key is to be a great defensive team,” Trimble said. “Turgeon said “If we wanted to be a great defensive team, we have to play without fouling and that next-play mentality.”

From there, Maryland made 56.3 percent of its looks, including six 3-pointers, and played clean defense to surge ahead. They out-scored Rutgers, 47-31, after the break and earned praise from their sixth-year coach.

“The second half is as good as we’ve been in a while,” Turgeon said.

Despite losing three straight and five of seven, Gill rejected a reporter’s notion Tuesday’s win was a “desperate effort.” He insisted the Terps bring the same mindset to every game.

But after muttering those words, he made sure to acknowledge the road win’s importance.

“We needed to get a win to get the momentum going toward the last game and the tournament,” Gill said, “so I’m glad we got the W.”