The unbeaten tournament leaders will complete their first clean sweep since 2012 if they can beat Ireland in Cardiff next Saturday, but they had to ride their luck in Edinburgh as Scotland mounted a second-half fightback.
Tries from Josh Adams and centre Jonathan Davies helped Wales to a 15-6 half-time lead but the wheels threatened to come off after the break.
Darcy Graham’s score set up a blockbuster finish but Wales hung on for an 18-11 victory that leaves Gatland on the verge of becoming the first coach to win three Grand Slams.
But the Kiwi confessed his side were guilty of eyeing up their decisive showdown with Ireland during the second half against Scotland.
🏴 18-11 🏴— Welsh Rugby Union 🏉 (@WelshRugbyUnion) 9 March 2019
As expected, a huge battle against an impressive @Scotlandteam - but Wales show strength and resolve to make it four from four in 2019 @SixNationsRugby.
Cymeriad rhyfeddol, perfformaid egnïol. Ymlaen i Gaerdydd gyda'r tîm uchelgeisiol Cymru. #HWFN #ForTheJersey pic.twitter.com/rYq3tUpoPb
“We were pretty comfortable during the first half but in fairness Scotland came out and put us under a lot of pressure in the second,” said Gatland.
“We’ve lost the second half 5-3 but we’ve shown some real character. There were a couple of moments towards the end when Scotland were attacking but we drove them back.
“Any team that’s won a Grand Slam – and I think back even to last year with Ireland and that Johnny Sexton drop goal – you look back at certain games and know you’ve had a little bit of luck.
“Maybe from a coaching perspective we needed to be a bit tougher at half-time. We talked at the break about being pretty comfortable and going out to deliver a second-half (performance). As a result, maybe we were thinking about next week and that Irish game.”
The build-up to the clash was dominated by domestic rugby politics in Wales, with a proposed merger between Scarlets and Ospreys being taken off the table.
Gatland admitted the debate had affected his team but praised them for shaking off the uncertainty to claim victory.
He said: “This is a fantastic group of men that are pretty tight. There’s no doubt this week has had an impact on the players.
“In fairness to them, after the early part of the week they have got on with the job. There’s obviously a lot of emotion involved with everybody, so I take my hat off to them for digging deep.
“We’ve spoken about forgetting how to lose and these guys are finding ways to win. I’m not sure in the past we’d have had the mental strength to keep Scotland out but these guys are finding ways to do that and that’s what good teams do.”
Scotland have now lost three successive games and face the daunting prospect of a trip to Twickenham next week to finish off their campaign.
Injuries to Tommy Seymour, Blair Kinghorn and Graham rubbed salt into their wounds and coach Gregor Townsend admitted he is still unsure whether star full-back Stuart Hogg will be back in time from a shoulder injury.
But his main frustration was the performance of French referee Pascal Gauzere, with Townsend questioning why he did not issue the visitors with a yellow card despite seeing them concede five penalties within their own 22.
He said: “We would obviously have liked to have won that game. We had errors – probably caused by the defence’s pressure. But we had chances.
“There were five penalties in the 22, and to not get anything from that seems like their indiscipline was rewarded and our pressure wasn’t.
“Was I surprised there was no yellow card? Yes. If teams are giving away penalties close to their own try line through cynical play, then you expect that to lead to yellow cards. That is how international rugby is refereed throughout the world.”
Know more about Sport360 Application