The Barcelona forward played a one-two in the middle of the pitch with substitute Ezequiel Lavezzi and raced through the Brazil defence cutting across to the left to send a low, diagonal, left-footed shot past the diving Victor into the bottom far corner.
"I really wanted to beat them and I was able to it. I'd never done it with the senior (Argentina) team," said Messi, who was playing against Brazil for the fourth time.
"It's an important win to keep improving and that's always easier when the results go your way," he told Argentine television in Doha.
The match at Qatar's Khalifa International stadium, in which Ronaldinho made a promising Brazil comeback, was a first victory for Argentina over their great South American rivals in six meetings since 2005.
"The two teams went forward. But at the end of the game we suffered the goal sadly. Messi is an excellent player, who settled the match in a moment we lost concentration," Brazil captain Robinho told Brazilian TV.
Ronaldinho, overlooked for the 2010 World Cup finals, might have scored with a cheeky backheel in the first half but Argentina goalkeeper Sergio Romero was alert and saved.
"The balance of Ronaldinho's performance is good... His choices as the player creating moves were good," Brazil coach Mano Menezes said.
Messi's goal was the first conceded by the new Brazil side coached by Menezes, who had won their three previous friendlies.
Sergio Batista was making his debut as Argentina coach after friendly wins over Ireland and world champions Spain and a defeat away to Japan in an interim capacity.
Brazil had more of the ball in the first half, spent more time in their opponents' half and created more chances.
Argentina, with a greater number of experienced internationals in their side, evened the exchanges in the second half as they pushed further up in midfield.
The Brazilians, quick in the build-up, used the width of the pitch well to stretch the Argentine defence in which Nicolas Pareja was winning a second cap as partner to Nicolas Burdisso.
Argentina played a tighter game looking for trademark short one-twos in their build-ups. Lavezzi came on for Gonzalo Higuain in the second half and Argentina gained width up front.
Right-back Javier Zanetti, extending his Argentine record to 138 caps, cut inside in Argentina's first telling counter-attack to shoot left-footed with Victor saving.
Brazil right-back Daniel Alves later hit the bar with a shot inside the box after a one-two with fellow defender David Luiz.
Minutes later, Romero went down to save Ronaldinho's backheel. He also punched away a dangerous free-kick from Ronaldinho.
Near the end of the first half, Messi start
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.