Nathan Benjamin’s winner moved Town up to sixth, and within two points of second place, with games in hand on all of the teams above them.
Last season it took a last-minute goal to beat Bourne at Abbey Lawns, and this time it took a questionable linesman’s decision.
The match started as recent matches have, with Melton enjoying the lion’s share of possession.
The visitors should have taken the lead in the 12th minute when former Bourne striker Zak Munton was played through with only Doran to beat, but the keeper parried his effort out to Sandy whose effort was also saved.
A Nathan Arnold short free-kick found player-manager Tom Manship alert, but his touch was palmed around the post by Doran.
Jordan Lever’s through-ball was missed by Cardell and Hood and fell to Munton who fired a low shot which was deflected past the post.
Bourne had a whole half of desperate defending as Melton piled on the pressure.
Doran made a string of saves, first from Sandy after Munton’s run down the right, then from Manship after Sam Beaver had played him in Manship.
Storey’s cross picked out Arnold in the box, who cut in and let fly, but the keeper touched it over the bar.
With Bourne looking to hold out until half-time, but with just two minutes left of the first half, Arnold brilliantly side-stepped Russell and fired in a shot which beat Doran at the near post.
The second half started badly for Melton when Joachim’s, with his first real sniff of goal, beat the offside trap and slotted past Town keeper Johnson to level.
Melton almost restored the lead five minutes later when Arnold’s free-kick was dropped by the keeper, but Munton’s follow-up was blocked on the line.
Storey’s low effort from range beat the keeper, but ended up on the wrong side of the post.
Tom Harris played a one-two with Manship to go clean on goal, but saw his shot blocked as Bourne put everything into defending the point.
But with 17 minutes left, a corner was poorly cleared by a defender’s head which hit the underside of the bar and looked to have crossed the line.
The referee initially played on, but after some protests the referee went to consult his assistant only to eventually award a goal.
There was more relief for the visitors straight from the re-start when Joachim appeared to kick the ball out Johnson’s hands as he was about to clear up field and planted the ball into an empty net.
It was a very close call to whether it was a legal challenge, but the verdict again went Melton’s way.
The visitors had another scare to survive when Hood found himself unmarked at a corner, but headed over from six yards.
A deserved win on chances and possession, but a lucky one on two close calls which went their way.
Town welcome crosstown rivals Holwell Sports to Signright Park on Saturday (3pm) after Wednesday’s Senior County Cup quarter-final on Wednesday at Allexton and New Parks (ko 7.30pm).
Town: Johnson, Beaver, Benjamin, Manship, Gilchrist, Fray, Munton (Hibbitt), Storey, Sandy (Price), Arnold, Lever (Harris).