A try by William Farquhar in the sixth minute of injury time presented the visitors with an opportunity to take a share of the spoils. But Colin Sturgeon, who had been outstanding for Marr, tugged the conversion left of the posts.
Marr struck first when Greig Jackson crashed over for an eighth-minute try, converted by Sturgeon.
Boroughmuir hit back with a penalty by Ciaran Whyte, who then added the extras after skipper Johnny Matthews had bagged his side’s first try.
Sturgeon squared matters with a penalty but tries from Ronan Kerr and Jordan Edmunds, the latter converted by Whyte, saw the hosts into a 22-10 lead at half time.
And the visitors battled back into the match when Fraser Grant capped a multi-phase attack by plunging over for a touchdown converted by Sturgeon.
Boroughmuir established a ten-point lead when Matthews grabbed a second score. Back came Marr through a Stephen Adair touchdown, converted by Sturgeon, who then restored parity with a penalty.
Then when Matthews scampered over to complete his hat trick in 77 minutes, and Whyte added the conversion, it looked as if the hosts had secured the elusive first win.
However, the visitors refused to surrender and Farquhar got the bonus point try deep into added time. But the missed conversion sparked relief and delight in the home camp and left Marr with two bonus points.