The victory, by 0.14 seconds, denied Shiffrin a sixth slalom win in six races this season and completed a weekend technical double for Rast after she won the giant slalom on the same slope on Saturday.
Switzerland's Wendy Holdener completed the podium, 1.83 seconds off her teammate's pace on the Podkoren 3 piste.
Shiffrin, who also won the last slalom of the 2024/25 season, stayed top of the slalom and overall standings with reigning slalom world champion Rast moving up to second in both.
"Mikaela won five slaloms (this season), and today I made it. It was really not easy, but I gave everything I had," said Rast.
Shiffrin had trailed her rival by 0.10 after the first run, with Holdener a distant third, but a storming and flawless second run left her on the brink of a record-extending 107th career success and 70th slalom win.
Rast instead went even faster to claim her career fourth win, and third in slalom, to establish her credentials as the leading Swiss female ski hope for next month's Milano Cortina Olympics and Shiffrin's biggest rival.
"I don't believe it's possible to win every race in the season with the competition level," said Shiffrin, who now has 163 career podiums.
"I wanted to give it my best shot, but I think that this was a really amazing show today."
USA teammate Paula Moltzan finished fourth.
"Clearly Mikaela and Camille are on an entirely different level, so it kind of just shows how much room for improvement there is," she said.
Italian-born teenager Lara Colturi, who will be competing for Albania at the Games, fell on the first run and halfway down a course set by her father, Alessandro.
Colturi, on the podium in four of the previous five slaloms, appeared unhurt.
Austria's 2021 slalom world champion Katharina Liensberger was absent after having successful knee surgery on Friday, following a crash in training that has ruled her out of the Olympics.
"The Olympic season is over," she posted on Instagram.
"I am very happy about all the successes I celebrated in 2021 in Cortina d'Ampezzo, and I wish all participants this year the best of luck and injury-free games."
