Logan Couture added a power-play goal and Joe Thornton scored an empty-netter to put the Sharks in control as the series shifts to Nashville for Game 3 on Tuesday night.
Mattias Ekholm tied the game earlier in the third and Ryan Johansen also scored for Nashville.
After San Jose blew a one-goal lead earlier in the third, the top line delivered when it mattered most. Joe Thornton slid a cross-ice pass to Matt Nieto, whose initial shot was stopped by Pekka Rinne. But Pavelski batted the rebound in for his sixth goal of the playoffs to give the Sharks the lead.