Pedro Morales sent a free kick toward the goal and Rivero redirected it past Orlando City goalkeeper Donovan Ricketts.
Rivero, in his first MLS season, scored his third goal in as many games — including two late winners.
"I've got players playing on fumes at the end, but one bit of magic, Pedro whips in a ball and Octavio manages to backhead it and we'll take the points," Whitecaps coach Carl Robinson said.
Vancouver (2-1-0) was penalized for time wasting in the 95th minute and it appeared the match was over. Darwin Ceren's careless challenge 40 yards out on the left flank set up the game-winning free kick.
Orlando City (1-1-1) dominated possession (62.7 per cent) but lacked in its final attack as the Whitecaps goalkeeper David Ousted needed only one save to earn his 19th career MLS shutout.
"I think as a group we defended very well, limited them to chances," said Robinson. "Like I said, they're a top team. Even though they're a new franchise team they've got some fantastic young players."
Ricketts deflected Rivero's breakaway chance in the 33rd minute.
(With files from The Associated Press)Suggest a correction