Rookie goalie Josef Korenar made 21 saves and earned his first NHL victory as San Jose snapped an eight-game losing streak, its longest since 2005.
The Sharks rewarded the small crowd that was allowed into SAP Center for the first time this season, as COVID-19 restrictions in California forced San Jose to play in front of empty seats at home until Monday.
"I think they were just as excited as we were," Sharks defenseman Erik Karlsson said. "It hasn't been an easy season for us, so it's nice to see that as many showed up as possibly could. They were happy to be here."
Karlsson, Logan Couture, Brent Burns and Noah Gregor all scored as the Sharks jumped out to a 4-0 lead by early in the second period. But they needed Barabanov's goal 11:17 of the third to help fend off a Coyotes comeback.
"He plays a real smart game," Sharks coach Bob Boughner said of Barabanov. "He's obviously got high-end skill, you can see that. You can tell he's dangerous in the offensive zone. He looks like a confident player."
Arizona fought back from a 4-0 deficit on goals from Michael Bunting, Clayton Keller and Jakob Chychrun to pull within one. After Barabanov's goal made it 5-3, Chychrun scored his second goal of the night with 4:44 left in the third to make it 5-4.
Evander Kane added an empty-netter for San Jose with 8 seconds remaining. He also had three assists.
Adin Hill made 21 saves for Arizona after replacing Darcy Kuemper, who was pulled in the second period after San Jose's fourth goal.
Chychrun took little solace in his team's ability to make a comeback Monday.
"You don't want to get in those spots, but it's going to happen throughout the season," he said. "It's a matter of sticking with it to get yourself out of it. We gave ourselves a chance tonight."
The Coyotes fell one point behind St. Louis in the race for the fourth and final playoff spot from the West Division.
San Jose is five points back.
Chychrun's 16 goals lead all NHL defensemen, but he spread the credit around to his teammates who are setting him up.
"When guys are doing the right things, it's easy to be in the right areas," Chychrun said. "Guys are making good plays right now and I'm getting some good looks."
A crowd of 520 was announced as the Sharks played their first home game in front of the general public since March 8, 2020. Families of players and staff were allowed in for Saturday's loss to Minnesota.
The team is limiting attendance per state and county guidelines. Fans needed to show proof of a full vaccination or a negative COVID-19 test to be admitted Monday.
Sharks players received a standing ovation as they took the ice for pregame warmups
The teams meet again Wednesday night in San Jose, then play twice more in the final week of the regular season.
Barabanov scores in front of the goal as Sharks down Coyotes
Alexander Barabanov is in the right place at the right time as he scores in front of the net, helping the Sharks take down the Coyotes 6-4.