It was Dostal's sixth NHL start and third since he was recalled from San Diego of the American Hockey League on Dec. 10.
"It's such a cool moment, getting a 'W' in this building, playing against [Connor] McDavid, [Leon] Draisaitl and those guys," Dostal said. "I'm just so happy for the boys that we were able to get a 'W'."
Ryan Strome had a goal and an assist, and Mason McTavish had two assists for the Ducks (9-20-3), who have won two in a row for the second time this season.
Connor McDavid extended his point streak to 12 games with a goal and an assist, Leon Draisaitl had two assists, and Stuart Skinner made 13 saves for the Oilers (17-14-1), who are 1-2-1 in their past four games.
Edmonton outshot Anaheim 23-2 in the third period, but only got the puck by Dostal once.
"We poured 49 shots on net," Oilers coach Jay Woodcroft said. "I thought their goaltender played pretty well, and I thought we can do a better job on the goals against."
Ducks defenseman John Klingberg scored his third goal in the past two games on a wrist shot from the wall to give them a 4-3 lead at 6:08 of the third period.