AMES, Iowa -- With the NCAA tournament just about a month away, teams are going to lean on their stars more than ever.

Iowa State standouts Melvin Ejim, DeAndre Kane and Georges Niang showed why the Cyclones could be in great shape come March.

Ejim scored 25 points, DeAndre Kane added 22 and Niang had 20 to help No. 17 Iowa State beat 19th-ranked Texas 85-76 on Tuesday night for its fifth victory in six games.

The trio shot 57 percent from the floor to lead the Cyclones (20-5, 8-5 Big 12), who became the third-fastest team to 20 wins in school history.

Iowa State outscored Texas 25-12 late in the second half to pull away and move within a game of the second-place Longhorns in the Big 12.

The Cyclones were keyed by Ejim, who had his second-best scoring game of the season, while Kane chipped in with five assists and zero turnovers and Niang helped keep Cameron Ridley without a field goal.

David Purdy/Getty Images

Isaiah Taylor had 26 points to lead the Longhorns (20-6, 9-4), who've followed up a seven-game winning streak by splitting their last four.

But even though Texas shot just 33 percent from the floor, it still hit some big shots in the second half.

The Longhorns could barely miss from the line either.

Javan Felix hit a 3 to match a crowd-energizing one from Matt Thomas, and Connor Lammert did as well with Iowa State on the verge of going ahead by double digits with 8:08 left.

Texas also hit its first 16 free throws and 23 of 25 overall to hang close. But Jonathan Holmes finally missed with 6:26 left, and Niang's ensuing putback gave Iowa State a 75-65 lead.

Felix had 16 points, but he needed 22 shots to get there.

Holmes and Ridley, who combined for 39 points and 18 rebounds in an 86-76 Texas win over Iowa State last month, teamed up for just 18 points and 14 rebounds on Tuesday.

Iowa State also outscored Texas 40-18 in the paint despite a 44-35 deficit on the boards.

The Cyclones had struggled of late on defense. They let up 102 points in a loss at West Virginia on Feb. 10 -- and followed that up by blowing an 18-point home lead against Texas Tech.

Iowa State's first defensive stand against the Longhorns was a disaster.

It got better from there, though.

The Cyclones allowed four consecutive offensive rebounds by Texas to open play, and Kane went to the bench with a neck injury. But Kane returned in time to hit Iowa State's first basket, and the Cyclones soon took a lead it would hold for most of the half.

Monte Morris found Ejim for an alley-oop to help Iowa State push its lead to 36-27, and his reverse dunk from the baseline made it 43-33. But Texas, which shot a dreadful 10 of 37 from the floor in the first half, hit six of their next 10 to pull even at 48-all with just over 14 minutes to go.

The Longhorns didn't have an answer for Ejim though -- and Kane and Niang also had their way with the Texas defense.

Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.