It was Longar's fourth double-double of the season and his first since he was suspended for two games after elbowing Tech's Esmir Rizvic in the team's meeting in Lubbock last month.
Tech coach Bob Knight suggested after that Jan. 6 game that Longar shouldn't be allowed to play again because Rizvic sustained a fractured eye socket on the play.
Longar, a junior center, responded with his best output ever against a Big 12 Conference foe. He was rewarded with a bear hug from Oklahoma coach Jeff Capel and a standing ovation from the crowd when he was removed with 24.2 seconds remaining.
Oklahoma (13-8, 4-4 Big 12) scored the final 13 points to pull away in a game that had been close throughout.
Jay Jackson tied his season high with 31 points and Martin Zeno added 20 points and 10 rebounds for Tech (15-8, 4-4), which has lost three in a row since beating top-10 foes Kansas and Texas A&M in back-to-back games in Lubbock.
The teams traded the lead 10 times in the first 13 minutes of the second half and were never separated by more than five points until the final three minutes.
Charlie Burgess beat Oklahoma's defense for a layup in transition and then completed the three-point play to give the Red Raiders a 59-55 lead with 6:53 left.
Michael Neal came back with a 3-pointer for Oklahoma, and Longar hit one free throw each on back-to-back trips to the foul line to put the Sooners back ahead 60-59. Neal then added two foul shots to make it a three-point cushion.
Longar skied to swat Jackson's runner on Tech's next possession, but the ball went straight to Zeno and he hit a jumper from the left side. Those were the last points the Red Raiders would score. Carter and Longar combined to score the next eight points from the free-throw line.
Jackson missed his final five shots, beginning with the one swatted by Longar, to finish 12-for-25.
Neal added 18 points for Oklahoma, which outrebounded Tech 38-27. Knight fell to 1-6 against the Sooners in Norman.
Oklahoma surged into the lead with an 11-2 run late in the first half that included a pair of baskets by Longar.
Longar gave Oklahoma a 24-23 edge on a putback of Neal's miss, then added a jumper from the left elbow before turning to Capel and pumping his fist. Carter, who was fouled during Longar's shot, added two free throws to stretch the lead to 30-25.
Zeno's driving layup made it 30-27 at halftime, and he also scored the first four points of the second half to start the string of lead changes.
Billy Tubbs, who was 333-132 as the Sooners' coach from 1981-1994 and guided Oklahoma to the 1988 national title game, was honored during a halftime ceremony.