The 31-year-old replaced David Marshall at half-time in the Philip II Arena in Skopje, having watched his team-mates dominate the first half. But Macedonia improved after the break, although Ikechi Anya gave Scotland a deserved lead on the hour mark.
Gilks looked confident from the start and was not seriously tested until the 70th minute, but he then produced a string of excellent saves.
The former Rochdale ’keeper got down well to stop Ivan Trickovski’s angled drive following a through ball and reacted quickly to smother the rebound.
Gilks then parried swerving strikes by Mirko Ivanovski and Trickovski behind for corners and was only beaten when Goran Pandev’s dinked pass caught out the Scotland defence and left Ivan Kostovski clean through from close range.
However, Shaun Maloney scored a wonderful late free kick to get Scotland off the bottom of their World Cup qualifying group and continue Gilks’ 100 per cent record in his three caps.
Gilks told the Scottish Football Association’s YouTube channel: “I have been getting a bit of stick – I should have held this and done that.
“To be honest, it’s a different kind of pressure playing at international level to club level.
“I have to take my hat off to these lads who do it every time we come away. Obviously I don’t. It was 45 minutes of pure concentration. Thankfully we got the win.”
The imposing goalkeeper’s previous appearances ended in friendly wins over Faroe Islands and Australia, but the game in Skopje was his competitive debut for his country.
Marshall had himself been deputising for the injured Allan McGregor before going off with a hip strain.
“I am over the moon we got the win,” Gilks said.
“I know they got one back but I thought we dominated the game. It’s difficult coming on but you have got to prepare properly. Thankfully I did and kept us in at 1-0 and then Shaun has won us the game with a great free kick.”
Gilks claimed he knew Maloney, who had only netted once in 30 previous internationals, was going to score when he picked up the ball after James McArthur had been fouled.
“When Shaun put the free kick down I knew he would score,” he said. “I was right behind it and watched it all the way in.”