The Anteaters had been shut out for seven innings before they broke through against Texas starter Nathan Thornhill (8-3) and reliever John Curtiss.
One of the last four teams selected for the NCAA tournament, UC Irvine (41-23) continued to amaze during a postseason run in which it knocked off No. 1 national seed Oregon State and swept a super regional at Oklahoma State.
The Anteaters advanced to a winner's game Monday against Vanderbilt or Louisville. The Longhorns (43-20) play the Vanderbilt-Louisville loser.
Evan Brock (9-6) earned the win, pitching 2 1/3 innings of no-hit relief and striking out the side in the ninth.
Texas scored its only run in the second inning on a squeeze play, and Thornhill hummed along in the middle innings after working out of early trouble.
The Anteaters stranded runners in scoring position each of the first four innings, leaving a man at third three times, and then had only one man reach base until the eighth.
Thornhill, a 13th-round draft pick of the Phillies, allowed only three runs over 37 innings in six starts before Sparks' drove a ball into a 35-mph wind that landed on the fringe of the warning track in left center. It was his third hit of the game.
Curtiss came on, and Chris Rabago drilled his first pitch up the middle to score Sparks. Jonathan Munoz added an RBI single for a two-run lead.
UC Irvine starter Andrew Morales, a second-round pick of the Cardinals, allowed six hits over six innings, giving up Texas' only run in the second. Collin Shaw doubled leading off the inning and later scored on Zane Gurwitz's bunt single.
The Longhorns had ample opportunity to pad their early lead, but they stranded 10 runners through five innings, eight of them in scoring position.
Texas is making its record 35th CWS appearance, with 75-year-old coach Augie Garrido trying to win a national title in a fifth decade. He won championships with Cal State Fullerton in 1979, 1984 and 1995 and with Texas in 2002 and 2005.
UC Irvine barely made the tournament after losing eight of nine to end the regular season. But the Anteaters, in the CWS for the second time, are not now and in position to make a run at giving 74-year-old Mike Gillespie his second national title. He won his first in 1998 at Southern California.
Vanderbilt 5, Louisville 3: Vanderbilt was happy to get runs any way it could against Louisville.
The Commodores scored their first one on a wild pitch and their last one on a passed ball in a 5-3 victory in the College World Series on Saturday night.
"Any momentum swing in this tournament is a big deal, and runs are tough to come by," Vanderbilt coach Tim Corbin said. "We were fortunate in a lot of ways tonight."
The Commodores (46-19) won a grinding, 3-hour, 40-minute game to advance to a meeting with UC Irvine on Monday night. Louisville (50-16) will play Texas in an elimination game in the afternoon.
Dansby Swanson doubled in two runs, and Bryan Reynolds tripled in another and made a fabulous catch in left field to help the Commodores beat Louisville for the first time in four tries.
Carson Fulmer (7-1), who got the start instead of first-round draft pick Tyler Beede, worked six innings for the win. Adam Ravenelle retired seven of the last eight Louisville batters for his first save.
"He was very valuable tonight," Corbin said. "He had a good heartbeat for the game."
Louisville pitchers struggled against Vanderbilt's patient batters. Losing pitcher Kyle Funkhouser (13-3) went six innings and issued six of Louisville's nine walks, its third-most of the season. The four runs he allowed matched his career high.
"It's hard to win at the College World Series with a bad start," Funkhouser said, "and that's what that was tonight."
The Commodores' biggest run came on a passed ball after they saw their 4-0 lead shrink to 4-3 in the seventh. It looked like catcher Kyle Gibson was setting up for a pitchout, but reliever Kyle McGrath pitched to the plate and Gibson let the ball get past him, allowing Vince Conde to score.
Sutton Whiting, who drove in Louisville's first run, said he the Cardinals must forget the loss quickly.
"It's over with, and we've got to bounce back," he said. "Come with a good practice tomorrow and get back to work and face a good team in Texas Monday."
Louisville, the only returning team from the 2013 CWS, swept the Commodores in super regionals last year and beat them again last month.
John Norwood scored the first of Vanderbilt's three runs in the second inning, coming home on Funkhouser's bases-loaded wild pitch. Swanson followed with his two-run double into the left-center gap.
"We've done a good job the last quarter of the season getting deep into the counts, more walks, less strikeouts, and we've hit the ball," Corbin said. "We've really hit the ball well the last three weeks. We hit it OK tonight, but we were facing a tough customer."
The Commodores led 4-0 against Funkhouser after Reynolds tripled in Swanson in the fourth. Reynolds had made the catch of the day to end the Louisville second when he went to the left-field wall to haul in a drive off the bat of Omaha native Grant Kay.
The Cardinals pulled to 4-2 in the fifth when Whiting hit an RBI triple and scored on a groundout, and it was a one-run game in the seventh after Zach Lucas narrowly beat Norwood's throw to the plate on Nick Solak's hit to center.
The Cardinals went 0-2 at last year's CWS, getting eliminated in an embarrassing 11-4 loss to Oregon State in which they committed four errors. They came to Omaha this week off five straight wins in the NCAA tournament.
Vanderbilt is at the CWS for the second time, and first since 2011.