Hofer has five shutouts in his past 26 starts.
Jimmy Snuggerud had a goal and an assist, and Jonathan Drouin scored in his first game for the Blues (25-29-9), who swept a road trip of four games or more for the first time since the 2023-24 season.
Ville Husso made 31 saves in the finale of a nine-game homestand for the Ducks (35-25-3), who had won seven of their past eight games.
After a scoreless first period, the Blues scored three times in the second.
Jordan Kyrou gave the Blues a 1-0 lead at 4:22 after bringing the puck into the Anaheim zone on a 3-on-1 breakaway and scoring over Husso's blocker with a snap shot.
St. Louis was on its second power play when Drouin scored into the far side of the net with a one-timer from the right face-off circle set up by Philip Broberg for a 2-0 lead at 10:07.
Drouin, as well as goalie Marcus Gidlof and first and third-round picks in the 2026 NHL Draft, was acquired from the New York Islanders on Friday for forward Brayden Schenn.
Snuggerud made it 3-0 at 12:11 when he scored with a snap shot from the right circle off a pass from out of the corner by Robert Thomas.
Snuggerud thought he scored again from in close off a feed from Thomas at 12:19 of the third period, but the Ducks successfully challenged for offside.
Pius Suter scored into an empty net with 4:02 left for the 4-0 final.