Millar missed three penalty attempts but found his rhythm just before the interval and then added three further goals in the second half to give his side a win that seemed unlikely against a Dundee team which looked better in the forward exchanges, which defended well and which, through their kicker Jack Steele, took their chances in front of the posts.
Outstanding for Dundee were scrum half Andy Dymock and the pacy No.8, Richie McIvor but, despite their efforts, the Mayfield side left the Borders with just a single championship point to show for their efforts.
Gala looked on course for a win with a try after only two minutes by scrum-half George Graham but a penalty by Steel and his conversion of a try by stand-off Brandyn Laursen put the visitors ahead.
Millar and Steele added one penalty apiece to leave Dundee 13-8 to the good at half-time but three perfectly executed Millar penalties to one by Steele gave Gala victory. leaving Dundee with relegation avoidance uppermost in their minds.