The Scots needed to win this encounter and tomorrow's return at the same venue to have any chance of avoiding a second qualifying event in New Zealand next year. And, in a match that ebbed and flowed, they looked favourites for much of the second half of a thrilling contest.
Instead, it was the Irish, already through to the World Cup, who prevailed with a ball to spare. However, this match surely served to dispel the widely held belief that Ireland are currently comfortably ahead of their Celtic rivals even though it might have looked that way when, set a target of 224, the Irish openers came out with all guns blazing to seize the initiative.
By the time Ireland reached 55-0 from 10 overs, William Porterfield had stroked seven boundaries in his 37 while the normally big-hitting Paul Stirling was able to play a secondary role. Stirling had moved to 30 before Haq made the breakthrough courtesy of Preston Mommsen's catch at short third man.
Three runs later the Scots had even more cause to celebrate when Porterfield departed for 62, Calum MacLeod diving forward to complete the dismissal off Iain Wardlaw's bowling.
With two new men at the crease Ireland needed to rebuild but Haq refused to allow them that luxury, the spinner luring Ed Joyce out of his crease for David Murphy to whip off the bails and then finding the edge of Gary Wilson's bat as the Northants wicket-keeper again obliged.
The O'Brien brothers, Kevin and Niall, now offered Ireland their biggest hope of recovering from a faltering position but the former was caught behind off Rob Taylor before MacLeod joined the attack to remove the other sibling.
Scotland now looked favourites and, despite resistance from Trent Johnston (24) and Max Sorensen (31), that was still the case when Ireland lost their ninth wicket still 14 runs short of their target.
However, with 12 needed from the last over, Tim Murtagh sealed it by thumping consecutive Rob Taylor deliveries for six and four.
Earlier, Scotland had their captain to thank for getting anything remotely close to a challenging total. Mommsen, having won the toss and electing to bat first, watched as his side slumped to 56-3 in the face of bowling which was no more than moderate.
Hamish Gardiner was first to go for just six when his first show of aggression resulted in a miscue down the ground off Murtagh and George Dockrell took a comfortable catch. Freddie Coleman fared little better, having made ten when he was bowled by Sorensen.
Matt Machan raised spirits by taking the attack to the home bowlers with a flurry of attractive shots. The Sussex man stroked four boundaries and heaved a big six over long-off on his way to 27 at better than a run-a-ball.
An extended stay from the hard-hitting left-hander would surely have seen Scotland claim the initiative.
However, Machan misjudged the length of a Sorensen delivery and succeeded only in chopping the ball onto his stumps.
With the Irish sensing blood, Mommsen and MacLeod dug in sensibly in a partnership which yielded 60 runs. But, once again, as Scotland threatened to take command, the pendulum swung back in the hosts' favour when MacLeod was bowled by Dockrell for 21 to be followed in fairly quick succession by Taylor and Richie Berrington.
Murphy and Haq became the third and fourth victims of left-arm spinner Dockrell as the Scottish innings threatened to implode on 165-8.
However, Sharif joined his captain in a late flurry, marking his top-flight return by stroking four boundaries in an enterprising 26.
His effort helped the Scots go beyond 200 while Mommsen was left unbeaten at the end, a stoic effort yielding 91 runs from 122 balls.
He stroked 10 boundaries but, with wickets falling regularly, was never able to unleash his full weaponry. Another few runs would have put the contest beyond Ireland and kept Scotland in contention for that second automatic World Cup spot.
Mommsen said: "It's a difficult one to swallow. We did so much hard work to get back into the game and didn't put the final nail in their coffin.
"To be honest we didn't do ourselves any favours in the field in the first 20 overs."