MacKinnon scored 3:40 into overtime on a 2-on-0 rush.
Jonathan Drouin scored twice, and Jack Johnson had two assists for the Avalanche (25-11-3), who extended their point streak to 7 games. Alexandar Georgiev made 28 saves.
Tyler Seguin scored twice, and Matt Duchene and Mason Marchment each had two assists for the Stars (22-10-5). Scott Wedgewood made 29 saves.
Mikko Rantanen tied it 4-4 at 18:49 when the puck deflected in off his skate during a scramble in the crease while playing 6-on-5.
Evgenii Dadonov gave Dallas a 1-0 lead at 11:57 in the first period when he intercepted a pass by Colorado forward Ross Colton and tapped it into the open net.
MacKinnon tied it at 1-1 at 13:44 when his shot deflected off Dallas defenseman Ryan Suter and past Wedgewood.
Seguin restored the Dallas lead 2-1 at 1:28 in the second period, pulling the puck backhand to forehand in the low slot.
Joe Pavelski made it 3-1 with a one-timer on the power play at 10:10 off a cross-ice pass by Duchene.
Drouin cut the lead to 3-2 with 12 seconds left in the period when he tapped in a rebound behind Wedgewood on the power play at 19:48.
Seguin made it 4-2 at 9:07 in the third period, toe dragging the rebound of his own shot around Georgiev off the rush.
Drouin scored his second to make it 4-3 38 seconds later at 9:45 when he deflected a point shot by Johnson.
Stars defenseman Miro Heiskanen left the game with a lower-body injury at 1:19 in the third period after a hard collision with Wedgewood in the crease. He did not return.
Avalanche defenseman Bowen Byram sustained a lower-body injury, exiting 3:16 into the third period after a shift that lasted 14 seconds. He did not return.