Second-tier Bristol City had their chances but midfielder Cavaleiro's 28th-minute finish at Ashton Gate ended their 15-match undefeated run and nine-match winning streak.
Victory kept alive Wolves' bid to win the FA Cup for the fifth time, with the Midlands club last having lifted the knockout trophy back in 1960.
Cavaleiro was one of three changes made by Wolves manager Nuno Espirito Santo to the side tha drew 1-1 with Newcastle, along with goalkeeper John Ruddy and Romain Saiss.
Nuno's decision-making was rewarded at both ends of the pitch, with Cavaleiro scoring after he was played in by the influential Matt Doherty, who hit the post three minutes later.
Meanwhile 32-year-old keeper Ruddy tipped Bailey Wright's shot over the bar after 69 minutes and then denied Marlon Pack from the ensuing corner.
Ruddy made an even better save to repel a close-range flick from Matt Taylor and even had to save a shot from opposite number Frank Fielding after the City goalkeeper came up for a corner in stoppage time.
Wolves now join top-flight rivals Manchester City, Brighton and Watford in the last eight, with Cup-holders Chelsea playing Manchester United shortly before Monday's draw in a repeat of last season's final.
"Of course the goal was important and I'm very happy to score but the most important thing is the team move on to the next round," Cavaleiro told BT Sport.
"It was a tough game, very hard game, they have great players, very good players and it was a great win for us."
Nuno added: "(I'm) very happy for the boys. It's a tough team. It's hard to defend when they put so many people in the box and you just hope for the best sometimes."
Asked about the draw, the Portuguese coach added: "You have to go game by game. I would like to play at home."