Luis Robles stopped a late penalty shot to help the Red Bulls (12-9-6) move into a tie with Montreal and Sporting Kansas City for first place in the Eastern Conference.
"It was a complete performance," Cahill said. "That's what we're all about."
New York won despite playing without star forward Thierry Henry for the first 57 minutes as punishment for his blow-up at practice with head coach Mike Petke.
Petke said he and the French star had a two-hour, air-clearing conversation in the coach's office after the parties settled down, and were on the same page.
"Sometimes it's like a tornado meeting a volcano," Petke said. "It's nothing serious, but it's being made a big deal about. It happens all over the world. It's just that it happened here. It didn't affect the team at all."
Still, Henry seemed steamed about it, even after he barely missed scoring two minutes after entering.
"You know I don't talk when I don't play," he said, discounting the fact that he played the last 33 minutes.
Petke called keeping his international star on the bench "a coach's decision.'
"I'm a coach and I make decisions every day," Petke said. "I made my decision and that's between me and my team."
Bradley Wright-Phillips made his first MLS start in Thierry's place and barely missed scoring in the 45th minute when Sam's pass fell just wide of the leaping forward.
United missed tying it in the 72nd minute after Ibrahim Sekagya pulled down D.C.'s DeWayne De Rosario in the box, resulting in a penalty kick for the midfielder and a red card for Sekagya. But Robles dove and reached to his right to preserve the lead.
"I knew it was huge to block that," Robles said. "There were some things he did that told me he was going there, some things I look for."
De Rosario knew he missed the game's best chance to come away with a point.
I'm disappointed in myself," he said. "I guess right. I hit on frame. But still, at a time like that, I think I should bury it.
Sam put the Red Bulls on the board in the eighth minute on a freak goal after Cahill was knocked down in the box. There was no call on the Cahill play, but the ball came out to the right wing to Sam, whose lofted shot hit the left post.
DC keeper Bill Hamid tried to gather it from the ground, but after a delay for an officials conference it was determined the ball had crossed the goal line for Sam's third score of the season.
Nick DeLeon got his first goal of the season for United (3-18-5), tying the score in the 36th minute. He took a chip from De Rosario from outside the box, made a move out front, and barely beat Luis Robles to his right.
Cahill got the tiebreaker a minute later, converting on a header off Jonny Steele's cross from the left side. It was Cahill's team-leading eighth goal.
Henry finally entered in the 58th minute for Cahill and made an impact two minutes later, dribbling into the box and firing a shot that barely went wide right.