Stanway Pegasus had the edge during the first half, having taken the lead in the 15th minute with an excellent strike by Kingsley Collins which gave Shrimpers goalkeeper Matt Huggins no chance of saving.
Huggins was called up to make a good stop in a one-on-one situation after the break when Pegasus threatened.
Harwich then came back strongly with Ewan Livingston (pictured) making a good run and from his dangerous cross the visitors' keeper made a good save.
The Shrimpers were pressing for an equaliser now, and from an attack Jaidan Smith's goalbound shot was diverted over the bar for one of a number of corner kicks.
Harwich thought that they had scored but after a consultation with the linesman, to the Shrimpers' dismay, the referee ruled out a goal.
However, it was not long before Harwich were on level terms, with Livingston the scorer.
Following a tackle, Harwich were reduced to 10 men with a red card.
The result was now on a knife edge with both teams looking for a winning goal and when the visitors' keeper was unable to hold on to a high ball, there was goalmouth scramble before it was cleared to safety.
With 10 minutes remaining, Pegasus took advantage to break away and catch Harwich short in defence with Christopher Suleman Kosko beating Huggins with a cool finish for the delighted visitors to take home all three points.