Senior catcher Willie Durazo answered in the bottom half of the inning with an RBI groundout that plated Jon Slack from third and tied the score 1-1.
Kansas State took a 3-1 lead in the top of the eighth when Ty Soto delivered a single up the middle, which scored Pat Maloney and Tim Doty.
Senior third baseman Jake Brown kept Tech (41-16) alive in the bottom of the eighth with a two-out double to right field, which plated Durazo and Cody Fuller from first.
Kansas State took a 4-3 lead in the top of the 11th on a bases loaded wild pitch by Tech's Steve Rowe, which scored Jeremy Rogers from third.
Smith tied the game 4-4 for Tech in the bottom half of the inning with a solo home run that skipped over the right-center field fence.
With the bases loaded in the bottom of the 12th inning, Smith blasted the game-winner on sacrifice fly to left field that plated Fuller from third.
Rowe (9-2) earned the victory with 3 2/3 innings of relief, while allowing five hits and one earned run. Mitch Walter (3-3) suffered the loss for Kansas State after giving up two hits and a run in an inning of work.
Tech will next play Nebraska, which outslugged Baylor 11-9, on Thursday at 5 p.m. during the second round of the Big 12 Tournament at the Ballpark in Arlington.