Brazil had struck against the run of play with goals from Fred and Oscar in the 33rd and 42nd minute. But Italy responded with two goals in five minutes through Daniele De Rossi and Mario Balotelli, bringing it level before the hour mark.
There were decent early chances for both sides, with Julio Cesar making a fine save to deny Emanuele Giaccherini before Gianluigi Buffon matched him to keep out Neymar's drilled shot.
Italy were enjoying most of the ball and creating the better chances in open play.
It was against the run of play that Brazil took the lead as Filipe Luis crossed from the left and Leonardo Bonucci's defensive header succeeded only in finding Fred completely unmarked at the far post, from where he coolly volleyed home.
Italy stuck to their game plan as they retook control of possession, and Alessandro Pirlo curled a shot narrowly wide from the edge of the area after some fine build-up play.
However, Brazil doubled their lead in fine fashion three minutes before the break as they hit Italy on the counter-attack again.
Oscar won the ball in midfield and allowed Neymar to bring it forward. The Santos man then played it back for Oscar to score with a wonderful flick off the outside of his boot finding a narrow gap inside the right-hand post.
Italy again looked strong to start the second half with Balotelli threatening before substitute Stephan El Shaarawy - a half-time replacement for Pablo Osvaldo - won a corner with a shot from a tight angle.
It was from that corner that Italy scored, with Brazil failing to deal with the ball and allowing De Rossi to stick out a boot and divert it through the crowd of players.
Moments later, Balotelli fired in a stunning equaliser, scoring almost out of nothing when he unleashed a powerful curling shot from the edge of the area while surrounded by Brazilian shirts.
Balotelli then wasted what looked a straightforward chance to put them ahead in the 63rd minute, taking time for a touch when all alone at the far post but unable to beat Cesar with the shot.