Uruguay began the game in second place in its pool behind the reigning champion and facing a daunting potential quarterfinal tie with Colombia, the only side to go through the group stage with three wins, AFP reported.
But Cavani's header eight minutes from time from Jonathan Rodriguez's cross propelled Uruguay above Chile and into, what looks on paper at least, an easier last eight challenge against Peru.
"In some moments we played well, in other moments less well, but always with the (right) attitude and mentality we were able to snatch the game," said the 32-year-old, who scored his 48th goal for his country.
But the Paris Saint-Germain forward insisted thoughts of a potentially easier quarterfinal draw played no role in Uruguay's approach.
"We wanted to win the group without knowing what would come next, to show a good image in the group and continue with this attitude," he said following the match at Rio de Janeiro's iconic Maracana stadium.
Veteran coach Oscar Tabarez admitted there was little between the two sides.
"It was a keenly contested match with few spaces. We managed a little bit better than our opponents," he said.
More so than avoiding Colombia, Tabarez was most pleased that Uruguay will get an extra day of rest ahead of its quarterfinal, against a Peru side that has had two extra days to recover from its pool efforts, on Saturday in Salvador.
Chile will face Colombia the day before in Sao Paulo.
"One extra day of rest is useful, it's important, because we're on the limit," said Tabarez.
Meanwhile, Japan coach Hajime Moriyasu said his team would learn from its Copa America heartbreak after missing out on a place in the last eight following Monday's 1-1 draw with Ecuador.
Shoya Nakajima gave the Blue Samurai a 15th minute lead in Belo Horizonte while substitute Daizen Maeda had a late chance to win it when put through one-on-one with goalkeeper Alexander Dominguez.
Angel Mena's equalizer on 35 minutes and teenage sensation Takefusa Kubo's potential injury-time winner being ruled out by VAR meant Japan came up short.
"They're learning to compete with top level opponents," said Moriyasu, who brought a mostly under-23 team to Brazil as several clubs refused to release regular first choice players.
"Our players need to learn as much as they can, with great humility, respecting their opponents and understanding that they can develop our football."
This squad will at least form the basis of the under-23 team that competes in next year's Tokyo Olympics.
But it was an inglorious exit for Asia's two guest participants in South America's flagship tournament.
Asian champion Qatar finished bottom of Group B with one point from three games, while the team it beat in February's continental final in the UAE, again failed to win a match in its second Copa America participation.
However, the Japanese did improve drastically on their opening match – a 4-0 thrashing by Chile – in drawing their next two games against Uruguay (2-2) and Ecuador.
"It's a shame that we couldn't progress to the next stage, we need to improve," said Moriyasu.
"Football is improving in Japan and in Asia in a general manner. We've managed to play good matches against strong teams from all over the world."