The Aggies (18-8, 4-7 Big 12) led by as many as 19 points in the second half before Texas went on a 16-1 run to get back in the game.
Texas (17-8, 6-5) cut the deficit to 61-57 before the Aggies scored seven straight points to stretch their lead back to double digits with about five minutes left.
The Aggies made nine free throws after that to secure the victory.
Gary Johnson led the Longhorns with 17 points, but had to sit for large parts of the second half because of foul trouble.
Donald Sloan added 14 points for the Aggies, who hadn't won since Jan. 31.