Barclay Goodrow and Tomas Hertl also scored, and Aaron Dell made 27 saves for the Sharks (29-18-8), who moved into second place in the Pacific Division, one point ahead of the Los Angeles Kings.
The Sharks built a 3-0 lead early in the second period, but Edmonton rallied to score the next four goals, including three in the second.
"It was kind of a weird game," Sharks forward Logan Couture said. "They tried to give it to us in the first and we gave it right back to them in the second. It seemed like no one wanted to win. Way too many mistakes by guys who shouldn't be making them and they end up in the back of our net."
Zack Kassian scored twice, and Leon Draisaitl and Brandon Davidson each had one goal for the Oilers (23-27-4), who lost their third straight. Montoya made 24 saves.
"This game has been the story of the year," Kassian said. "We can't sustain any momentum once we get it for any length of time. We're not going to give up, but at the same time I'm not happy about clawing back and then watching the team fall back. Everyone is frustrated."
Davidson gave Edmonton a 4-3 lead at 1:21 of the third period, putting a rebound past Dell. Hertl tied it 4-4 at 3:41, lifting a backhand from the low slot into the upper-right corner.
The Sharks took a 1-0 lead at 1:15 of the first period when Ryan scored his first NHL goal on a wrist shot from the left point. Ryan's father, Bill, was in San Jose, along with many of the Sharks fathers, but he missed the game.