Having lost the first two sets, Russia twice found themselves a match point down in the third but roared back to claim their first gold in the event for 32 years 19-25 20-25 29-27 25-22 15-9.
"I think that those people that did not believe in us, they turned their back and went away after the second set, but those who trusted, they are the most valuable. I think we have shown our character," Russia's Sergey Tetyukhin said.
Brazil cruised through the first two sets, winning the first three points of the match and rarely surrendering the lead thanks to some inventive play that outfoxed a powerful and physically-imposing Russian team.
The best of five-sets match looked to be heading towards an early conclusion but when Brazil squandered two gold-medal points a fired-up Russian side powered back into the game.
The 7-foot 2-inch Dmitriy Muserskiy led the charge, upsetting the Brazilian side's rhythm at the net with a series of key blocks and point-scoring spikes.
Russia then dominated the fourth set as Brazil lost the poise and guile that served them well early in the contest.
"I think their coach had a very good idea in placing Muserskiy in his position. After that, it was just the game we played. I think that we weren't able to handle their spikes and that left us a bit anxious," said Brazil's Lucas Saatkamp.
The younger and taller Russian team then won by six clear points in the decider to claim their first Olympic volleyball gold since victory on home turf in the 1980 Moscow Games.