Paul Arriola gave D.C. the lead in the third minute. Zelarayan tied it in the 45th minute on a penalty kick before Pedro Santos scored in the 66th and Zelarayan tallied 10 minutes later to make it 3-1.
The Crew (12-13-8, 44 points) are tied with D.C. (13-15-5, 44 points), two points behind the seventh-place New York Red Bulls for the final playoff spot in the Eastern Conference.
New York has two matches left. D.C. and the Crew each have one game left. Columbus would have been eliminated with a loss.
Zelarayan then zipped a shot from outside the penalty area for his team-leading 11th goal. He has three goals in the past two games in the absence of injured striker Gyasi Zardes.
D.C. got the early advantage when Felipe sent an overhead ball to Arriola down the left side. Arriola ripped a volley to the far netting for the U.S. national team forward's sixth goal of the season.
The Crew got a shot in the 22nd minute by Santos earmarked for the bottom left corner, but Hamid made the stop.
Crew coach Caleb Porter returned to the bench after missing three games following a positive COVID-19 test on Oct. 19.
D.C. and the Crew played for a third time this season. The previous two meetings were in Columbus, where the Crew won 3-1 on May 8 and lost 4-2 on Aug. 4.
Each team finishes the season Nov. 7. The Crew hosts Chicago, while D.C. plays at Toronto FC.