It was Gibson's first shutout since Nov. 2, 2021, against New Jersey, and his second in 14 career games against the Stars.
The shutout appeared to be in peril after Troy Terry was called for tripping with 1:55 remaining, but the Ducks were able to kill off the power play. Gibson tied Guy Hebert for second in franchise history with 173 wins.
Adam Henrique also scored for the Ducks.
Scott Wedgewood made 25 saves for the Stars.
Henrique scored his 12th goal of the season and third in the past four games when his shot from just outside the left faceoff circle deflected off the stick of Dallas defenseman Jani Hakanpää and past Wedgewood's glove at 3:11 of the first period.
McTavish extended the lead eight minutes later on a one-timer while the Ducks were on a power play. The 19-year-old center took a cross-ice pass from Trevor Zegras and buried it. McTavish has 22 points (seven goals, 15 assists), which is third among NHL rookies.
The Central Division-leading Stars have dropped two straight after a four-game winning streak. They are 1-2 in the second game of back-to-backs.
Roope Hintz took a puck off the right leg during the second period but was able to return.
Stars: Return home to host the Florida Panthers on Sunday.
Ducks: Host the San Jose Sharks on Friday.
AP NHL: https://apnews.com/hub/nhl and https://twitter.com/AP_Sports
Joe Reedy, The Associated Press