The two-time British & Irish Lions tourist and Scotland skipper produced a moment of magic to open the scoring for the visitors at the Stadio Olimpico after a nervy opening quarter.
Scotland held on to remain 5-0 ahead at the half-time break before their patience was rewarded soon after the restart with their second try, finished off by Chris Harris.
Federico Zani was then sent to the sin-bin in the closing minutes as Hastings added Scotland’s third try late on to ensure the visitors secured a hard-earned win on the road.
With both sides going into the contest without a win after the first two rounds of the Championship, it was no surprise that the opening stages were so tentative in the Italian capital.
But it was not long before Hogg started to make his mark, launching a huge kick deep into the Italian 22 to provide Gregor Townsend’s men with their first attacking platform.
While the chance was not capitalised on, Scotland soon had the first opportunity to get points on the board with a penalty – only for Adam Hasting to miss the target.
The pressure continued to build on the Azzurri, though, and it finally paid off on 22 minutes when Hogg beat Jake Polledri and Jayden Hayward to race over in the corner.
Scotland thought they had a second try on the half-hour mark but Ali Price’s celebrations were cut short when a TMO review found that Hamish Watson’s pass in the build-up was forward.
Italy had an opportunity to cut the gap just before the break but Tommaso Allan was unable to convert a tricky penalty attempt, ensuring Scotland remained 5-0 ahead at the interval.
With such a narrow lead, the visitors came out after the restart with renewed vigour and doubled their advantage on 46 minutes when Harris crossed the whitewash.
But Italy refused to go away and remained right in the contest until they were reduced to 14 men in the final ten minutes after Zani was sin-binned for a tip tackle.
And Scotland put the game to bed in the final minute when Hastings spotted a gap down the left wing and cantered in for the visitors’ third try, which he also converted.
Speaking afterwards, Hogg said: “We’re delighted with that. We came here to do a job and we’ve done exactly that. I’m so proud of the boys. Our boys had a huge challenge in terms of their back-row.
“We challenged our boys to stand up and you can see that with Hamish [Watson] getting man of the match, backed up by Jamie [Ritchie] and Maggie [Magnus Bradbury].”
On his spectacular score, Hogg added: “Thankfully it just opens up for me but there’s a lot of method in the madness to get us into that position.
“I’ve had a lot of chat over the last couple of weeks about that [the drop against Ireland] and I wasn’t making a mess of that one.”