The referee issued a red card to Sebastian Saucedo for a studs-up challenge on Mauro Rosales in the 76th minute. The Whitecaps (5-2-1) quickly capitalized when Mattocks headed home Russell Teibert's left-footed cross 4 minutes later.
It was the first goal conceded by Real Salt Lake (2-1-3) in 262 minutes.
Real Salt Lake returned to even strength when the Whitecaps' Jamison Olave was sent off for his second yellow card in the 89th minute.
Vancouver goalkeeper David Ousted had four saves in his fourth shutout of the season.
Real Salt Lake's loss makes the New York Red Bulls the last unbeaten MLS team.