Messi had gone three games without a goal - a relative drought for a player whose goalscoring exploits have been remarkable since he opened his Barca account in May 2005 - and had appeared to be struggling for fitness prior to Milan's visit to the Nou Camp in the Champions League.
But the Argentinian rediscovered his touch in front of goal with a double, the first from the penalty spot, as Martino's men won 3-1 to secure a place in the knockout stages.
Martino said: "Making negative assertions about Leo has risks. He played phenomenally well today, there was a spark to his play.
"He always comes out on top in these kind of situations."
Barca's other goalscorer, Sergio Busquets, added on fcbarcelona.com: "We knew it was only a matter of time because he's decisive and in front of goal he's always on form."
Martino was pleased with a win which saw Barca move five points clear at the top of Group H. Their next objective is to make sure of finishing in top spot.
Martino said: "We're happy, we've reached an important objective.
"Qualification is what we were looking for, and it's good that we got it early.
"We have the obligation to finish at the top of the group, it will be especially good for our self-confidence."
Although Barca were more cohesive than in recent weeks, Martino still found room for improvement.
"At times we allow our rivals to get into the game after we take a lead," he said.
"We have to be more decisive when it comes to winning back possession. There is always something that can be improved. I would love it if everyone liked how we play, but that's not the case and that's why we train on a daily basis."
Under-pressure Milan boss Massimiliano Allegri rued the absence of key men Stephan El Shaarawy and Mattia De Sciglio.
"I'm disappointed with the result, but the performance was not bad," he said on uefa.com.
"In the first half we were unable to launch counter-attacks when we had the chance to do so, mainly because we missed too many passes, but in the second half we played better.
"I'm sure we will be more balanced and will get better results when we recover important players like Stephan El Shaarawy and Mattia De Sciglio from injury."
Allegri left star striker Mario Balotelli on the bench due to a niggling fitness concern and a dip in form, before bringing him on at half-time.
"Mario Balotelli suffered an injury not so long ago and his recent performances have not been great, so I preferred to start with the duo [Kaka and Robinho] who did very well in Milan against Barcelona," he said.
"Still, Balotelli played well when he came on for the second half, creating a couple of good opportunities.
"Mario has extraordinary qualities, but he has to return to his very best both physically and mentally. I decided to start with him on the bench for his and the team's good."