Brazil had struck against the run of play with goals from Fred and Oscar in the 33rd and 42nd minutes.
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.
Fernando lined up an ambitious free-kick from 26 metres out in the 17th minute, and although Buffon looked unconcerned, the ball only just sailed wide of the left post.
Italy was enjoying most of the ball and creating the better chances in open play.
Pablo Osvaldo headed a difficult chance just over after getting on to Balotelli's cross from the left, while a long ball over the top found the run of Cristian Maggio, only for the full-back to mishit from a fabulous position, allowing Cesar to make the save.
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 its game plan as it 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 its lead in fine fashion three minutes before the break, hitting 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, a wonderful flick off the outside of his boot finding a narrow gap inside the right post.
There was almost time for Italy to get back in it before the break. Osvaldo looked to have miss-kicked Maggio's cross but the ball was dribbling goalwards until Cesar stretched to paw it away.
Italy again looked strong at the start the second half with Balotelli threatening, before substitute Stephan El Shaarawy - a half-time replacement for 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.
Italy now looked the more likely winner, but Balotelli wasted what looked a straightforward chance to put it 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.
The AC Milan striker then got on the end of a great through-ball from Alessio Cerci but his shot was deflected over.
There was then a worrying sight for Italy and Roma 10 minutes from time as De Rossi went off injured with a heavily strapped thigh after reaching for a defensive header.
The match was petering out after maintaining an unusually high tempo for a friendly, but Italy still had chances, with Cerci blazing over from a corner and El Shaarawy shooting narrowly wide after great build-up play.
But as it was, the two sides settled for a share of the spoils.