Texas fought back from an eight-point deficit in the second half. Ramey led the charge, scoring eight points of Texas' 10 points in the run to take the lead. A 3 by Ramey and a dunk by Jericho Sims got Texas within 65-63 before Ramey made his 3 from the left wing for the lead.
"We've had some close games were weren't able to grab hold of. Courtney had a phenomenal second half," Texas coach Shaka Smart said.
Iowa State's Rasir Bolton then got open underneath with a chance to retake the lead but missed the contested layup. Twice he grabbed the rebound only to miss two more putbacks before Kai Jones was fouled and made two free throws to extend the Texas lead.
"Saw the rim," Bolton said. "Just missed it."
After Iowa State was called for an illegal screen with 29 seconds left, Texas was able to play keep-away and drain another 12 seconds off the clock before Coleman was fouled and made his free throws to push the lead to five and seal the victory.
Ramey, Coleman and Sims each scored 14 points for the Longhorns (14-7, 4-4 Big 12). Sims also had nine rebounds, none bigger than when he finally grabbed the ball after Bolton's final miss.
Texas didn't shoot a free throw until 13:47 to play, then went 9 of 11 down the stretch.
Tyrese Haliburton and Bolton each scored 14 for Iowa State (9-12, 2-6).
Iowa State: The Cyclones will rue giving away a chance to get a rare road win. They led most of the game and twice built the lead as high as eight points in the second half. The Cyclones still don't have a win on an opponent's home court this season.
"We've had a couple of gut punches this year,"Iowa State coach Steve Prohm said.
Texas: The Longhorns got back to .500 in league play, but their road in the Big 12 gets a lot tougher over the next 10 days with games at No. 3 Kansas, at home against Texas Tech and No. 1 Baylor.
"We talk every week about where we are. One of our goals is we want to play and advance in the NCAA Tournament," Smart said. "You have to go grab some of those games. We have a heck of a stretch coming up.
Texas got a spark from freshman forward Donovan Williams, who tied his season high with 13 points in 11 minutes. He made a playground 3-pointer early in the second half when he dribbled in a circle while defended then launched a long, unexpected shot that swished. Williams was 3-of-5 from long range.
"It's a real thing at the college level. Freshmen, they have an ignorance-is-bliss to them," Smart said. "There's so many things they don't know, but it can really work in their favor."
Iowa State plays at No. 12 West Virginia on Wednesday
Texas plays at No. 3 Kansas on Monday
For more AP college basketball coverage: https://apnews.com/Collegebasketball and http://twitter.com/AP-Top25
Miller scores 20 to carry Utah St. past Colorado St. 83-64
— Brock Miller had a season-high 20 points as Utah State extended its win streak to 11 games, defeating Colorado State 83-64 on Tuesday night.
Scott, Quintana lead LMU past San Diego 72-69 in OT
— Eli Scott had 20 points, Joe Quintana scored six of his 15 points in overtime, and Loyola Marymount extended its home win streak to seven games, edging past San Diego 72-69 on Tuesday night.
Champagnie's 31-point effort helps send Pitt past Duke 79-73
— Justin Champagnie tied a career-high 31 points on 12-for-15 shooting and grabbed 14 rebounds, and Pittsburgh held off Duke for a 79-73 win on Tuesday night.