The Sharks made the deal a day after starting goalie James Reimer left a loss to Vegas after one period with a lower-body injury. Backup goaltender Adin Hill has also been sidelined for San Jose but could return soon.
Stalock has appeared in five games this season with Bakersfield in the AHL, going 3-1-0.
He returns for a second stint with San Jose after being drafted by the Sharks in the fourth round in 2005.
Stalock played 62 games over five seasons with San Jose. He went 24-19-7 with a 2.37 goals-against average and .911 save percentage.
Stalock missed the 2020-21 season with an injury but in his most recent NHL action in 2019-20, he posted a 20-11-4 record, a 2.67 goals-against average and a .910 save percentage with the Minnesota Wild.
Stalock has a career record of 61-49-18, with a 2.61 goals-against average and a .909 save percentage.