The talented full-back replaced Andre Santos in Thursday's Confederations Cup semi-final against hosts South Africa on 82 minutes with the score goalless.
Two minutes from time, the Barcelona man's fiercely struck free-kick from the edge of the area sailed into the far top corner to hand Brazil a 1-0 victory and a place in the tournament's final.
"Daniel Alves trains every day at set-pieces and I thought if we had a few opportunities left to try and win the match with a free kick in front of goal, he would be the man," Dunga told a new conference.
"It turned out perfect for us. But it was a very difficult game. They made it very hard for us. We knew South Africa were going to counter-attack and defend very deeply and they did."
Title holders Brazil will face the United States, who secured a shocking 2-0 defeat over Spain in Wednesday's semi-final, in the Confederations Cup final on Sunday.
"The US have their own peculiar way of playing. We will sit down and analyze what we have to do to beat them but that will not be easy either," Dunga added.