Julien Lewis added 15 points, including the game-winning basket in the final second.
The Longhorns (15-16, 7-11) scored the first bucket of the game, then the Red Raiders went on a 9-0 run. The Longhorns tied the game a few times but did not lead again until overtime.
Texas Tech led 34-17 with 5:24 to go in the first half, but McLellan and Lewis would help the Longhorns rally.
The Longhorns trailed by seven at the half, 37-30, and came out with a more aggressive defensive approach in the second half to help them force overtime.