Police say the "modus operandi" is the same in each case and the mayors of the two cities fear a "cold-blooded killer" is on the loose.
Two of the people died. One's tent was set on fire, after he was stabbed and shot.
A reward is now being offered to catch the killer.
DC's Metropolitan Police Department said one man was shot on 3 March and another on 8 March - both in the middle of the night.
They were injured but survived.
Just a day later, emergency services responded to a tent fire in the city where they found a man inside who had been fatally shot and stabbed.
In New York, a masked suspect first shot a man sleeping on a street in Manhattan's Soho neighbourhood in the early hours of the morning.
Deputy Chief Hank Sautner of the New York Police Department said at a news conference: "The victim, who was shot in the arm, woke up and shouted 'what are you doing?' and the suspect fled."
Around one hour later, according to police, that same person shot and killed another man also sleeping in Soho.
"We now have a cold-blooded killer on the loose," DC Mayor Muriel Bowser and New York City Mayor Eric Adams said in a joint statement.
Mayor Adams said watching CCTV footage of the fatal shooting in Manhattan was "chilling".
"The case is a clear and horrific intentional act of taking the life of someone, it appears, because he was homeless," he added.
Police in DC are offering a $25,000 (£19,100) reward for information leading to the gunman's arrest and police in New York are offering a $10,000 (£7,650) reward.
The federal Bureau of Alcohol, Tobacco, Firearms and Explosives has also joined the investigation.
New York police are further investigating the death of another homeless man Manhattan on Sunday night. The cause has not been determined and it is not yet clear if the case is linked to the other string of shootings.