Libyan Mustafa Elsherkisi, 49, called his victim "a P*** b*****d" shortly before plunging the blade into his chest. Mohammed Idris Mirza, 47, died in his brother's arms.
At the High Court in Edinburgh yesterday, judge Roger Craik, QC, told Elsherkisi that the murder was "completely unnecessary" and ordered him to serve at least 15 years before he can ask to be freed.
An earlier trial heard how neighbours in Stenhouse Gardens North, Edinburgh, clashed over the mess left by Elsherkisi's dog, a Japanese Akita.
Elsherkisi, a former diver and chef, said that the death of Mr Mirza, who had had heart surgery, was "a terrible accident".
But a jury rejected his claim that he had stumbled and fallen during a row in the common stair and that he had not intended to inflict the fatal wound.
It found Elsherkisi guilty of racially aggravated murder.
The dead man's widow, Pakistan-born Farzana, 40, said she had been afraid of Elsherkisi since the first day he had moved into a flat near her home.
She said his dog regularly fouled the garden and she had made a number of complaints.
She said: "I went to put the laundry out and everywhere there was dog foul. I asked him to clean it up because it is the laundry area and he just shut the door."
She said she was reluctant to tell her husband about the row because he had suffered three heart attacks and had undergone triple bypass surgery.
The dead man's brother, Mohammed Iqbal Mirza, described the fatal encounter on 26 May this year.
He said he witnessed an argument which seemed to end with his brother heading upstairs. Then Elsherkisi came out of his flat and racially abused the other man.
Mohammed Idris Mirza asked the Libyan what he had just said, then gasped: "The guy has stabbed me."
Iqbal Mirza said his brother then collapsed, and he saw blood gushing out of his chest.
Mr Craik told the accused: "The killing was completely unnecessary, even though tempers had been running high and even though there was probably abuse on both sides.
"You had gone back to your own home and you could have stayed there.
"Your victim was apparently on his way back to his own house when you attacked him and the wound inflicted was severe and fatal."
Elsherkisi moved to Britain about ten years ago and said his wife had the Akita when he married her.
They moved to the Stenhouse at the beginning of this year and he claimed that every time he took the dog out he cleared up any mess.
Mr Mirza, originally from Pakistan, and his family had lived in a block of flats in Stenhouse Gardens North for 15 years.
Solicitor advocate Maurice Smyth, defending, said Elsherkisi was genuinely remorseful for the catastrophe which had engulfed Mr Mirza's family.
"The whole episode is a nightmare and he suffers from guilt that a man has died," Mr Smythe said.
The judge recommended that Elsherkisi should be deported when he is freed from prison.