Toronto (1-2-1, 4 points) beat D.C. for the first time since June 17, 2017.
United (2-2-0, 6 points) has lost two straight after opening the season with a pair of wins.
Jayden Nelson nearly got the home side on the board in the fifth minute, driving down the left side before firing from the left side of the box, but United goalkeeper Bill Hamid got a piece of it to deflect it up and over the net.
Russell Canouse, in his first appearance this season, gave United a 1-0 lead in the 10th minute. Robertha showed patience along the left side outside the box looking for an open seam before sending a right-footed kick inside the box that was headed by Canouse into the net.
Alejandro Pozuelo tied it 1-1 for Toronto in the 24th minute on a set piece. Midfielder Luca Petrasso directed a corner kick into the goal area, where it grazed off Michael Bradley to Pozuelo, who had some space in front to get it by Hamid.
Osorio put Toronto in front in the 53rd minute. Petrasso, from the left side of the box, sent a cross to a streaking Osorio at the far corner of the goal area, with Osorio dropping and sliding for the kick to put the home side ahead 2-1.