The world champions had to rely on a desperate Beauden Barrett tackle to prevent Hogg from scoring a try that would have tied the scores in the last minute.
"I'm happy that we came out on top".
Scotland skills coach Mike Blair is relishing the challenge of proving themselves when they take on a strong New Zealand side this weekend. "Stuart's gutted he didn't but it's just one of those things", said Barclay.
This had been a day on which history was made with a defeat for New Zealand on the rugby field at the hands of a side that have never beaten them before but astonishingly could and perhaps should have seen it happen at both ends of the world.
"They're a team on the rise and world rugby has got some good teams which I reckon is really exciting for rugby".
The All Blacks outscored their hosts three tries to two in Edinburgh on Sunday (NZ time) but were scrappy at times and were given a tough test by a side who are still to beat them in 33 meetings.
Scotland were monumental in the first half and led 3-0 for 35 minutes.
With seconds remaining, the valiant Scots thought they might at last have the glory of a win over New Zealand as Stuart Hogg burst down the sideline.
Coach Gregor Townsend noted afterwards that his men had got into the opposition 22 on 17 occasions in all and two tries might be seen as representing a disappointing return on that, but for all the temptation there might be to put this down as just one more gallant defeat, he was right this time to draw the positives from it. "The courage to keep on going was great to see and encouraging for the future - also the belief in the squad". "I think it generated an atmosphere that was one of the best I've ever been involved in. It was great Test match, intense and competitive". Conversions: Barrett (2). Penalty: Barrett (1). They dominated every facet of play and played the game at pace and with intent.
And, to quote the Murrayfield cliche of the week, they don't get any bigger than the All Blacks.
Codie Taylor, Damian McKenzie and Beauden Barrett scored tries for New Zealand after the sides were deadlocked at 3-3 at halftime, while Jonny Gray stretched over for Scotland's first try and Huw Jones added a second three minuets from time.
But as Cane returned, replacement prop Wyatt Crockett was yellow-carded, for another foul in defense.
There were less than four minutes left at that point, but Scottish resolve was exemplified by that last Hogg break, albeit Barrett's determination to stop him similarly showed just why the All Blacks are the best on the planet.