Stalock made 38 saves and rookie Tomas Hertl scored the first of San Jose's three first-period goals in a 5-2 win Sunday.
It was Stalock's second victory, his first since his debut on Feb. 1, 2011, when he stopped the nine shots he faced in relief in a 5-3 win against the Phoenix Coyotes.
"He's waited a long time," Sharks coach Todd McLellan said. "He was a bit of a sparkplug for us tonight. I think the guys really wanted to play for him. I thought he handled himself well. They're a big team that create a lot of crease opportunities. There are a lot of bodies going there and whacks at the puck and he handled himself really well."
San Jose improved its League-leading record to 10-1-1.
"I think coming back was huge," said Stalock, who was sidelined for nearly a year when he was seriously injured in a minor-league game just days after his first outing with the Sharks. "Just being able to play the game again was a big step for me. It started in the [ECHL] a year later and I was lucky enough to make it back to the NHL.
"It seems every interview I can't get out of an interview now without the injury question, and I think I'm past it hockey-wise. I pray that it doesn't happen again to me or anybody else. It's behind me and I'll answer questions about it any time, but I don't think it's affected me in any way.
Hertl scored his eighth goal at 1:16 of the first. Andrew Desjardins made it 2-0 with his first goal at 6:35.
Tommy Wingels scored the Sharks' third goal of the opening period with a shorthanded effort at 18:15.
Ottawa also found itself down by two early in Friday's 2-1 loss against the Anaheim Ducks.
"It's something we've got to work on," said Senators center Kyle Turris, who set up Erik Karlsson's goal that drew Ottawa within 2-1. "It's frustrating. We're at home. We want to get off to a good start. We talk about it in the room and we just come out a bit flat and give them a couple of opportunities and it ends up in the back of our net."
Niemi was rested for the first time this season after recording his second shutout in three games Saturday in a 2-0 win against the Montreal Canadiens at Bell Centre.
The Senators' 40 shots were the most allowed this season by the Sharks, whose previous high was 31. San Jose had limited its opponents to 24 shots or less in each of its four previous games, and through eight of its first 11.
"I saw a lot early and I was able to feel it," Stalock said. "They were kind of shooting from everywhere which I expected they would, not being in a game yet, and I was lucky enough to make saves."
Anderson stopped 24 shots for the Senators, who have lost three of four.
Both of Ottawa's goals came on drives from their defensemen. Erik Karlsson drew the Senators to within 2-1 at 11:07 of the first with his third goal on a one-timer from just inside the blue line. Marc Methot closed the margin to one once again with his first goal at 9:09 of the second.
Methot drew Ottawa within 2-1 with a slap shot past Stalock into the top right corner from the left point.
Karlsson had nine shots, including six of the Senators' 17 in the first. That was one short of tying the team record for shots in a period, which was accomplished three times.
Marian Hossa was the most recent Senators player to achieve the feat. He had seven shots against the Canadiens in the third period of Ottawa's 4-2 win on Dec. 9, 2000.
Left wing Matthew Nieto was left out of San Jose's lineup despite taking a team-leading seven shots Saturday.
"Matty's got an upper body injury," McLellan said. "I don't think he's going to be really long, but he wasn't able to play."
Senators mascot Spartacat held up a purple sign with Roger Neilson's name on it prior to the game in honor of Hockey Fights Cancer Awareness Night at Canadian Tire Centre. Neilson, who died of cancer in June 2003, was an assistant coach for the Senators when Jacques Martin relinquished his coaching duties to him for the final two games of the 2001-02 season so that Neilson could reach the 1,000 games milestone as an NHL coach.