Adam Fox also scored and Igor Shesterkin had 21 saves to help the Rangers win for the third time in five games (3-1-1).
Logan Couture scored for San Jose with 17 seconds left to break up Shesterkin's shutout bid. James Reimer stopped 41 shots.
Gauthier got the Rangers on the scoreboard with 6:03 left as he tipped Jacob Trouba's hard shot from the point past Reimer for his third of the season.
Fox had an empty-netter with 1:07 left to put the Rangers up 2-0. It was his sixth.
Couture, standing on the right doorstep, then got a pass from Tomas Hertl from in front and quickly put it past Shesterkin for his his ninth.
Sharks forward Nico Sturm went to the locker room after getting boarded by Rangers defenseman Ryan Carpenter late in the first period but returned to the game in the second. Carpenter was issued a two-minute penalty for boarding.
Rangers: At Los Angeles on Tuesday night.
Sharks: Host Ottawa on Monday night.
AP NHL: https://apnews.com/hub/nhl and https://twitter.com/AP_Sports
Gideon Rubin, The Associated Press