Trailing by a goal to nil after just three minutes, Dunga’s side had to come from behind to secure victory and had to wait until injury time to achieve it, courtesy of a Douglas Costa strike.
The triumph leaves them level on points in Group C with Venezuela, who surprisingly defeated Colombia 1-0 earlier in the day.
Brazil headed into the clash seeking a ninth title in the competition - but they got off the worst possible start.
Christian Cueva opened the scoring early on, capitalising on a dreadful attempted clearance from goalkeeper Jefferson and smashing the ball into the back of the net.
The lead would last just two minutes though, as an inspired Neymar found himself unmarked in the box to convert a header into the bottom corner from Dani Alves’ cross.
Having become the youngest player to score 44 goals for Brazil, he then sought his 45th and saw one effort hit the crossbar on 53 minutes.
The Barcelona forward was involved again to help snatch the win, cutting inside before teeing up Costa, who slotted in at the near post to extend his side’s winning streak to 11 games.
Brazil face Colombia next on Wednesday.