Buster, a springer spaniel, alerted its handler at a ferry terminal that Kieran Murphy and Laurence McAllister were travelling with large sums in cash.
A search was carried out on the horsebox the men had, and almost 25kg of cannabis was found hidden inside bags of molasses at Cairnryan, near Stranraer.
The drugs were worth in excess of £240,000 in Scotland but their street value would have doubled in their destination of Northern Ireland.
McAllister, 56, was yesterday jailed for five-and-a-half years and his co-accused Murphy, 46, was sentenced to five years imprisonment.
Judge Lord Uist told the pair at the High Court in Edinburgh: "This was a large and valuable consignment of drugs which indicates drug dealing at a high level. The idea of using a horsebox for the transportation of controlled drugs is a novel and ingenious one."
The judge said that whoever thought of it must have considered it "a foolproof method" of taking drugs to Northern Ireland.
Lord Uist said that fortunately the scheme had been thwarted thanks to Buster.
He added: "Someone has lost a great deal of money as a result of the police discovery of these drugs."
McAllister, of Kells, County Antrim, who was on bail at the time of the offence, and Murphy, of Rathfriland, County Down, had earlier denied being concerned in the supply of the drug in April this year, but were found guilty by a jury.
The pair had travelled via Dublin to Holyhead to the UK mainland and were intercepted as they made their return to Northern Ireland. Lord Uist said that as a result of the good work of Buster it was found they had significant amounts of cash with McAllister possessing more than £6000.
Inside the horse box were hessian bags containing plastic bags of molasses with 24.5kg of the drugs. The judge said McAllister, a horse dealer, had commissioned his co-accused to drive him on the expedition in the horse box.
Lord Uist said he had amassed numerous previous convictions for mostly trivial offences and had never previously been jailed.
The judge told him he was playing for high stakes when he undertook the trip but must now suffer the consequences of his criminal behaviour.
Defence counsel Simon Gilbride said McAllister, a father of three, had a farm in Northern Ireland and has made arrangements for it to be looked after by his children.
William McVicar, solicitor advocate for Murphy, said he had been a man of some standing in his community in the past.