Trevor Zegras and Josh Mahura also scored and Zach Aston-Reese had an empty-netter for the Ducks, who had lost six of seven. Anthony Stolarz made 31 saves to beat San Jose for the third time this season.
"We know obviously those games don't mean anything for our team in the standings," said Comtois, who scored just his fifth goal in 51 games this season. "But for me I want to play good and I want to have a momentum going into the summer for my workout. ... I'm happy the way I'm playing right now and I've got one more and it's just to kind of build some momentum for next year."
The Sharks started slowly one game after posting their biggest win of the season, when they rallied late to force overtime and beat Vegas in a shootout on Sunday night to harm the Golden Knights' playoff chances.
San Jose has little else to play for outside of a spoiler role as the Sharks will miss the playoffs for a third straight season for the first time in franchise history.
"I think San Jose could probably play a better game," Ducks coach Dallas Eakins said. "Their last game against Vegas was probably an emotional night being able to beat them. Sometimes there's a bit of a letdown."
The Ducks are in a similar situation, missing the playoffs for the fourth straight season and coming off an emotional game Sunday night when Ryan Getzlaf played the final game of his career.
Anaheim converted on an early power play in the first when Zegras beat Kahkonen up high from in close. The puck got stuck in the netting and no one reacted immediately to the goal before Zegras raised his hands in celebration when he finally realized he scored his 23rd of the season.
Anaheim then seized control with two goals in 56 seconds early in the second period that came right after the Ducks killed off a penalty.
Comtois got the first when he finished off a give-and-go with Kevin Shattenkirk. Milano made it 3-0 with a backhand from the slot.
The Sharks got back into it with a power-play goal from Burns and a deflection by Reedy late in the second period but couldn't tie it, hitting two posts on one shift in the third period.
"I thought we played hard," forward Matt Nieto said. "Some errors at times. We just couldn't get those timely goals."
Mahura scored midway through the third to give the Ducks an insurance goal.
The Ducks signed center Sam Carrick to a two-year contract to keep him through the 2023-24 season. The 30-year-old Carrick established career highs this season in goals (11), assists (8) and points (19) in 64 games.
In 111 career games with Anaheim and Toronto, Carrick has 15 goals and 15 assists.
Sharks D Erik Karlsson missed his seventh straight game with a lower-body injury. There had been some hope of him returning before the end of the season but coach Bob Boughner said Karlsson hasn't been skating and ruled out that possibility. Karlsson finished his fourth season in San Jose with 10 goals and 25 assists in 50 games.
Ducks: Visit Dallas on Friday night.
Sharks: Visit Edmonton on Thursday night.