The defeat ended Wisconsin's Big Ten-record run of 17 straight winning seasons in conference play. Using a starting lineup that featured three freshmen and two juniors, the rebuilding Badgers (10-15, 3-9) rallied from a 10-point halftime deficit before fading.
Huerter's driving layup with 1:25 left put the Terrapins up 62-60. After a Wisconsin misfire on the other end, Huerter bounced a runner off the glass.
Brad Davison answered with a 3-pointer for the Badgers with 10.6 seconds left. Cowan then made two foul shots for a three-point cushion, and Maryland's Dion Wiley sealed the victory by swatting away a layup try by Davison.
The Terrapins (16-9, 5-7) ended a three-game skid with the victory, which featured 12 lead changes.
Ethan Happ scored 18 points for Wisconsin, which has lost eight of nine. The Badgers are 1-8 on road, including 1-6 in the conference.
After being outscored 18-1 by Northwestern at the outset of Thursday night's game, Wisconsin flipped the script and bolted to an 18-11 lead.
Maryland went ahead with an 11-3 run, then scored the final 11 points of the first half to go up 33-23.
The advantage stood up until Davison and Nate Reuvers each scored four points in an 11-2 spree that put Wisconsin on top with 9:42 remaining.
The Terrapins were without 7-foot-1 center Michal Cekovsky, who was in a walking boot after bruising his left heel in practice last week. Maryland lost Justin Jackson (shoulder) and Ivan Bender (knee) in December.
Maryland will be at Penn State on Wednesday. The Terps beat the Nittany Lions 75-69 on Jan. 2.