The man was able to call for help to the other crew members, and Lewis fled the vessel, later handing himself into police.
His victim suffered a collapsed lung and had to have his left ear sutured, spending eight days in hospital.
Two months previously, Lewis had headbutted his then-partner twice in the face during an argument at the house they shared with their two children. When she fled with the kids to a neighbour's for safety, he trashed the house. Lewis was on bail for the assault when he attacked his workmate.
In his appeal, Lewis argued a discount to his sentence should have been given because of the mental health issues he was suffering from at the time.
Lewis had previously been hospitalised for "mania and psychoses" following the death of his mother in 2013.
He spent time at the Henry Bennett Centre and was given medication, but a planned follow-up never took place and Lewis did not continue his medication.
After he was bailed for the assault on his partner, he was referred to his local mental health service, which described him as having "developed a morbid state of mind".
But it was only after he was being held in prison for the knife attack that Lewis was diagnosed.
He told a prison psychiatrist that in the weeks leading up to the incident, he had changeable moods, mainly lows, and felt the other crew members were talking about him and laughing at him. He felt an increasing sense of tension, and began entertaining violent thoughts of killing himself or others.
He was admitted to a secure forensic unit, where he was given anti-psychotic medication. He "improved within a few days", the Court of Appeal decision said, and his mood and improved mental state has continued. Lewis has been "entirely cooperative with treatment and has not posed any concerns to nursing or medical staff", the decision said.
At sentencing, the judge did not consider Lewis' mental health problems had contributed to the attacks "in an important way" and decided against reducing his sentence because of that.
However, the Court of Appeal said the bipolar disorder - also known as manic depression - was a factor, even if a small one.
"That there is some link between Mr Lewis' mental illness and the wounding offence is also consistent with the inexplicable nature of that offending," the appeal court said.
"The victim said the offending was 'out of the blue...[Lewis] has lost it before but not this level of violence'. This was not a planned event and some loss of rational control is evidenced."
A reduction to his sentence was appropriate, the decision said.
"Although the link with the wounding offence in a causative sense was limited, his mental state was such as to moderate his culpability."
The Court of Appeal quashed the original sentence, and imposed a new one of five years and nine months imprisonment. The sentence of one year for the domestic violence charge remained, and would run concurrently.