Next up for the Borderers is a trip to Edinburgh on Saturday to play Watsonians, currently third from bottom with three points. That game kicks off at 3pm.
Gavin Wood put the hosts ahead at the Greenyards with an unconverted try on 10 minutes, but their guests hit back seven minutes later with Isoa Matacagi crossing the line and Fraser McKay adding the extras to go in at half-time 7-5 up.
McKay added to Dundee’s lead with a penalty a minute into the second half.
Struan Hutchison responded in kind five minutes later for the hosts, though, and on 55 minutes Wood took a speedy tap penalty and went over to the right of the posts for a try, with Hutchison first converting then kicking another penalty six minutes later.
Only a minute later, James Brown darted up the stand side at Greenyards to score an unconverted try and put Melrose further ahead.
McKay scored for Dundee with penalties on 66 and 71 minutes, but Melrose were in no mood to allow them to catch up.
On 78 minutes, after a succession of picks and drives, Hutchison went over the line for an unconverted try to give his side a bit more breathing space.
Further gloss was added to the scoreline as the game neared its end by a Lewis Mallin interception and dash up the pitch to touch down between the posts, followed by a Hutchison conversion.