Richard Ord decided he had to confront the gunman who shot his partner or he would be next.
Mr Ord's former business associate, Martin Lyttelton, has denied charges of attempted murder, grievous bodily harm and aggravated burglary and is on trial in the High Court in Auckland.
Mr Ord told the court that he wrestled with Mr Lyttelton and narrowly escaped being stabbed.
Mr Lyttelton's defence is that his mind was clouded by his mental illness and he went to Mr Ord's home to commit suicide.
Mr Ord described how he and his partner had been looking at photos from a family wedding when they noticed Mr Lyttelton coming up the stairs, armed with a gun.
They shut themselves in their office and put their weight against the door as Mr Lyttelton tried the handle. Mr Ord said he could see the handle moving but Mr Lyttelton could not get in.
"The shot came through the door and it was like a 'thwat' and all this human tissue and clothes and that went splattering up the wall."
That shot hit his wife, Colleen Fenton, in the leg.
He said he chose to confront the gunman because if he did not, he would be shot next. He opened the door and got Mr Lyttelton in a kind of bear hug.
The two men wrestled their way downstairs with Mr Ord eventually getting hold of the gun. He said he tried to fire it but it was not loaded.
Once at the bottom of the stairs, Mr Lyttelton pulled a knife on him, he said.
"All of a sudden he took his hand off the gun and reached and fumbled around in his pocket and he went like that, and I looked down in the nick of time and this huge knife just missed me."
Mr Ord's demonstration of Mr Lyttelton thrusting at him showed the knife missed him by centimetres.
He said Mr Lyttelton gave up the knife just as the police arrived.
Mr Ord broke down when he described being able to get back to his wife, who lay injured upstairs. He was able to give her a hug as a police officer tried to stop the bleeding, he said.
Under cross-examination from Mr Lyttelton, Mr Ord confirmed that Mr Lyttelton had never verbally threatened to kill or harm him or his partner.
Mr Lyttelton asked Mr Ord about telling him he needed to go, once the incident was over.
"I believe it must have been clear to you at that point that you had a seriously mentally disturbed person in front of you at that point."
Mr Ord responded: "I wouldn't know how to judge one's mental character."
Mr Ord then answered a series of questions about his past business dealings with Mr Lyttelton that ended in an expensive court battle. He firmly denied accusations of being a liar or a serial litigant.
The trial, before Justice Asher and a jury, is set down for three weeks.