Melo Trimble added 16 points for the second-place Terrapins (23-5, 11-4 Big Ten), who blew an 11-point halftime lead but finished the game with a 12-6 run. Wells moved past Joe Smith at 25th on Maryland's all-time career scoring list (1,292).
The victory improved Maryland's home record to 17-1. The Terrapins are 9-0 in games decided by six points or fewer, and they've won their last three by a total of 17 points.
Maryland led 55-52 before Trimble made a driving layup and was fouled. He missed the free throw, but after Wisconsin misfired twice on the other end, Trimble iced it with a pair of foul shots. The Terrapins missed nine of their last 10 shots.
After the final buzzer, hundreds of fans stormed the court to celebrate the Terrapins' most significant win in their inaugural Big Ten season.
"It started with our student section, they were great tonight," head coach Mark Turgeon said. "They came out early, they were camping out. They gave us great energy, and we fed off that.
"It was a great win for us. We had a lot of guys play well. Dez Wells was terrific. He was not going to let us lose. He was great defensively. He was great rebounding. He was great scoring, with four assists and no turnovers. It was a total team effort."
Frank Kaminsky scored 18 for Wisconsin (25-3, 13-2) and Sam Dekker added 14. The Badgers' 10-game winning streak was their longest since an 11-game run in 1941 to win the national championship.
Wisconsin hadn't lost since Jan. 11 at Rutgers.
After scoring a season-low 20 points in the first half, Wisconsin opened the second half with a 13-4 run to close to 35-33. Kaminsky made three baskets during the spree and Josh Gasser made Wisconsin's second 3-pointer of the game.
After Maryland bolstered the margin back to six points, Dekker made a pair of 3-pointers and Nigel Hayes connected from beyond the arc to bring the Badgers to 45-44 with 8 minutes remaining.
The game was tied at 47 before Wells made four straight free throws to put Maryland ahead for good. His dunk made it 53-48 with four minutes to go.
Wells scored 14 points in the first half, and Maryland limited Wisconsin to 30 percent shooting (1 for 11 from beyond the arc) in taking a 31-20 lead at the break.
It was the fewest points scored by the Badgers in the first half this season, and marked the first time they trailed after 20 minutes since Dec. 3 in a loss to Duke.
Wisconsin led 7-4 before Wells scored 12 points in a 19-5 run that made it 23-12 and gave the sellout crowd reason to believe an upset was a distinct possibility.
The Terrapins seemed content to run down the clock before shooting, a strategy that produced a driving layup by Trimble for a 27-16 lead. At that point, Wisconsin coach Bo Ryan called a timeout to organize his defense and calm the crowd.
Maryland missed its next five shots, but during that time the Badgers cut only four points off their deficit.
The half ended, appropriately, with Wells feeding Trimble on an in-bounds pass for a beat-the-buzzer layup.
Maryland plays host to Michigan on Saturday at noon on Senior Day. The game will be shown live on ESPN.