Lithuania, three-times bronze medallists, scored 18 points in the final five minutes of the third quarter to go from 46-32 down to 54-50 going into the final period.
When Rimantas Kaukenas hit a three-pointer to open the fourth period, the gap was just one. But Russia dug deep to pull out the win.
Victor Khryapa hit a three in response to Kaukenas, and five quick points from Sergey Monya made it 64-55 with 5:46 left in the game.
Lithuania came at Russia again in the final stages, with Mantas Kalnietis nailing a long three and Jonas Valanciunas adding a pair of free throws to make it 74-69.
Andrei Kirilenko responded for Russia, but a three-point play from Darius Songaila had it back to a five-point game, 77-72, with 95 seconds left.
The game became scrappy as the pressure rose. Songaila turned the ball over, and Alexey Shved missed both free throws for Russia after being fouled.
We tried to take our chances and I think we fought hard, but we were maybe nervous and we turned the ball over. Playing against this team, that will cost you.Kestutis Kemzura
Kalnietis came up empty with a three-pointer, and Vitaliy Fridzon made him pay with two free throws making it 79-72 with 32 seconds left.
Martynas Pocius missed a pair of free throws for Lithuania, and Kirilenko finished it off from the line.
'I'm thankful to win this game, it was not easy and we had to play our heart out,' said Russia coach David Blatt.
'I think this is a big step for our country and for our basketball,' Monya said. 'Now we're in the semi-final of an Olympics and I think we deserve it.'
Lithuania coach Kestutis Kemzura said: 'Today we faced a really strong opponent... We tried to take our chances and I think we fought hard, but we were maybe nervous and we turned the ball over.
'Playing against this team, that will cost you.'