The incident occurred during the second half of the game in the Spanish capital on Wednesday, and prompted an immediate reaction on Twitter from Rooney.
"Pepe. What an idiot. Sometimes people wind u up," the England forward wrote on the social networking site.
When Messi then set Eric Abidal up for Barca's winner, Rooney added: "Haha. That goal serves pepe right."
Guti, though, believes that it was unfair of Rooney to admonish Pepe for an act of petulance given his own track record of on-field indiscretions, hinting that only he who is without sin should cast the first stone.
"I laugh at Rooney," the former Real Madrid star wrote on his Twitter page. "But there are many saints in heaven, and if you want to be a saint you must lead by example. Making mistakes is human."
Guti, who played for Real Madrid for most of his career, has been without a club since parting company with Besiktas in November.
How do you stay up to date with football when on the move? With http://m.goal.com – your best source for mobile coverage of the beautiful game.