After an aggressive opening the Scottish spinners, Angus Beattie and Haroon Tahir, had pegged the Irish middle order down, but Rock immediately went onto the attack, surviving a clear chance when he had made just six, and his partner Graham Kennedy soon responded, lifting his own game.
The pair added 55 for the sixth wicket, and after Kennedy departed for a 65-ball 43, Rock and Josh Little put on a further 63 from only 39 deliveries as the Scottish bowling and fielding crumbled, setting up an exciting conclusion.
Just 8 were needed when Rock was stumped off Rory Johnston for 53, made from 46 deliveries with five fours, and only two when, in the next – and penultimate – over, Little was caught behind off Ihtesham Malik for a 23-ball 37 with four fours and a six.
The game was back in the balance, but the two singles needed came off the first four balls of the final over, and Ireland were home with two balls to spare.
It had all been very different as Scotland dominated the first 36 overs of the match after James Dickinson won the toss and Owais Shah (92) and Calum Garden (81) put on 170 in an outstanding opening stand which gave their side a wonderful platform.
It took a great catch by JJ Garth at long on to break the partnership, but the rest of the batsmen were unable to capitalise, and it was only Rory Johnston’s unbeaten 26 which enabled them to reach a total of 231 for six, at least 30 fewer than had seemed likely when Shah and Garden were in full cry.
Ihtesham Malik again bowled impressively as Ireland began their chase, and then the spinners slammed on the brakes.
But it was Rock, supported by Kennedy and Little, who would have the last word.