The centre-back was faced with the difficult keeping the Argentine sensation and attacking team-mates Sergio Aguero and Lautaro Martinez quiet in their Copa America semi-final.
The Selecao's tactics worked as they limited Argentina to just two shots on target in the game, while goals from Gabriel Jesus and Roberto Firmino fired Brazil through to the tournament decider against surprise package Peru.
Still, Messi managed to have a total of four attempts in the semi-final and set up four chances for team-mates.
And Marquinhos admits that shutting out the five-time Ballon d'Or winner was no easy feat, especially with the stomach problems he was suffering.
"It was not easy, no," the Paris Saint-Germain defender told reporters. "Messi was having an inspired night, not only him but the whole Argentine team, they made a great game.
"It was very difficult, but I think the team managed to cancel out the attacks of Argentina well. The ones we could not had some lucky chances with balls hitting the post and Alisson made some great saves. That makes a strong and solid team.
"On the day of the game, I ended up suffering a virus, and I spent the day at the hotel. It was very complicated, I had diarrhoea and was vomiting.
"I still managed to play, but with the effort I put in it worsened and eventually I had to leave the game."
And Marquinhos says his condition only got worse after he was substituted for Miranda in the 64th minute.
"After the game, it ended up getting worse too," he added. "I had a fever and I ended up having to go to the stadium infirmary, but I managed to get an injection and I feel better."
The 25-year-old is expected to be fit to face Peru in the final on Sunday, after Argentina play Chile in the third-place play-off on Saturday.