Troy Terry had a power-play goal and Isac Lundestrom and Derek Grant also scored to help the Ducks end a three-game losing streak that followed an eight-game winning streak.
"We had a good stretch there where we're playing well and getting results, and then went on the road and we didn't play our best, and obviously we didn't get the results we wanted either. So I think the focus coming home was to get back to what we were doing that made us successful. Worry about us and not the opponent, and I thought we did a pretty good job of that," Grant said.
Stolarz got his fourth career shutout, and rookie center Trevor Zegras had two assists.
Anton Forsberg made 29 saves for the Senators. They have dropped four in a row and have only one victory in their past 11 games.
"There's no lack of effort there today," Ottawa coach D.J. Smith said. "They're trying. They're frustrated we're not scoring, and when you're losing you open it up a bit and you give up other chances."
Rakell extended Anaheim's lead to 4-0 at 9:05 of the third period, getting to the edge of the paint for the chip shot to finish off a clever passing sequence from Sonny Milano to Zegras to Rakell.
Rakell has two goals and two assists in a three-game points streak since returning from an upper-body injury that kept him out for 10 games.
Terry put the Ducks up 3-0 with 43 seconds left in the second, building up speed before cutting right and putting a backhand shot in between Forsberg's legs. It was Terry's fourth power-play goal and 13th overall, pacing the team in both categories.
Grant made it 2-0 with 9:32 to go in the second by scoring off the rush after Anaheim killed a penalty. Victor Mete tried to bat the loose puck away after Grant's shot was stopped by Forsberg, but it struck Tyler Ennis and went it.
Ennis could do nothing but hang his head after the inadvertent gaffe, which came after he lost his footing in the neutral zone to allow Grant to race down the ice with the puck.
"I'll take as many of those as I can get," said Grant, who hadn't scored in his first 17 games this season.
The Ducks broke through with 3:17 left in the first on Lundestrom's fourth goal from a one-timer in the low slot.
Anaheim was 1 or 3 on the power play and held Ottawa to 0 for 4. The improvement on both units, which ranked in the top eight in the NHL coming into today, has been a major catalyst for the Ducks' strong start. Coach Dallas Eakins credited the arrival of new assistant Mike Stothers for bringing a new attitude to special teams, especially on the penalty kill.
"Every day is a desperate day on them," coach Dallas Eakins said. "Our killers are very, very well prepared for anything that comes out there."
IN THE MUCK
Ottawa was held scoreless for the third time in six games and has allowed 26 games in that span.
"We're gonna have to really reach down deep," Smith said. "Obviously we're a fragile group. Coming on this trip losing all three, guys are just getting back to health, and we need to win just to feel good about ourselves."
NOTES: Zegras has four assists in his past three games. ... Milano has two goals and two assists in a three-game points streak. ... Ducks F Adam Henrique returned to the lineup after sitting out at Colorado on Wednesday because of an upper-body injury. ... Senators G Matt Murray was a healthy scratch after allowing four goals on 27 shots in a 6-3 loss at Ottawa on Wednesday. Filip Gustavsson backed up Forsberg. ... Senators D Josh Brown is expected to miss four to six weeks after sustaining an upper-body injury against Colorado on Monday.
Senators: At Los Angeles on Saturday.
Ducks: Host Toronto on Sunday.