Ribeiro put in the puck after Troy Brouwer deflected a shot from the blue line.
The Capitals lead the series 3-2. Game 6 is Sunday in New York.
The home team has won every game in the series, with Washington taking the first two and New York pulling even in Games 3 and 4. The Capitals have been fighting history along the way: The franchise has lost eight playoff series in which it has held a two-game lead.