John Ison was accused of allegedly stealing documents, installing computer spyware and making secret recordings while working for Nikki Sinclaire, to ingratiate himself with the party leadership.
His old boss, Sinclaire, who represented the West Midlands region in Brussels and Strasbourg until 2014, is currently on trial for allegedly submitting "significant" expenses claims she knew to be false, according to the prosecution.
The defence's case is that prosecution witness Mr Ison first tried to "undermine" Sinclaire, and when that appeared to fail he took advantage of the confusion around the Brussels members' expenses system to set up his employer.
MORE: Former MEP told bureaucrats expenses claims had been 'deliberately corrupted'
MORE: Former UKIP MEP 'claimed thousands in car costs despite flying more cheaply'
Mr Ison denied that accusation in court, and also said he never stole documents.
A Birmingham Crown Court jury hearing evidence against Sinclaire on Friday was told by her barrister Sean Hammond there was "a background of hostility" between Mr Farage and the MEP.
In a short phone call to Mr Farage - covertly recorded by Mr Ison in January 2010 - the former aide told the politician it was likely Sinclaire would have the party whip restored.
Mr Farage is heard to reply: "Mad."
Later, jurors heard how Sinclaire lost the party whip in 2010 over an internal disagreement, but was seeking to rejoin through an appeal to its national executive committee.
Mr Hammond claimed that during the period Sinclaire treated Mr Ison as a "confidante".
However, in a text conversation about Sinclaire with a local party colleague in February 2010, he accepted replying: "Ok, Plan B - fraud."
At one stage during proceedings Mr Ison used his right not to incriminate himself, by declining to answer whether he had breached the Computer Misuse Act, after being presented with evidence he hacked Sinclaire's personal laptop.
Sinclaire's barrister asked Mr Ison if he had installed spyware on an office computer, before bragging to a party colleague about the information he had gathered as a result.
In a message in January 2010 to Steve Morson, described in court as then chairman of the Ukip regional office, Mr Ison wrote "I have just captured the entire data from Nikki's laptop", ending the message with a smiley face.
A reply allegedly sent by Mr Morson read "lmao", which the court heard was shorthand for "laughing my a**e off".
Asked by Mr Hammond if he sent the laptop message, Mr Ison replied: "Yes."
Mr Hammond put it to him: "Had you just done that (to the laptop)?"
Choosing to invoke legal privilege against incriminating himself, Mr Ison replied: "I decline to answer."
When Mr Ison was asked by Mr Hammond if he was acting as a "spy or a mole", he replied: "If you want to put it that way."
Later, a message alleged to have been sent in reply by Mr Morson read: "I'll see if I can get you an Oscar."
Mr Ison replied "Nikki (Sinclaire) is going to get me a 'foxtrot oscar' when she finds out", referring to a slang term meaning f*** off.
On the day when Sinclaire was due to make her case to the party's national executive committee, a message was sent to Mr Ison allegedly from Mr Morson.
The text suggested Ukip, then led by Baron Pearson of Rannoch - known as Lord Pearson - had "backed down under the threat of legal action, which Lord P said we would lose".
Mr Ison replied in his message: "Ok, Plan B - fraud."
Asked in court whether he sent that message, he replied: "Yes, I did."
He added "obviously that comment looks very bad", but denied any wrong-doing.
Earlier, asked by Mr Hammond how often he spoke to Mr Farage about Sinclaire, Mr Ison replied it was at least "once a week" by January 2010.
The ex-MEP's barrister then asked: "You would regularly brief him and give him sensitive information from your employer?"
Mr Ison replied: "Yes I would."
When Mr Hammond then asked if he did so to "undermine" Sinclaire, Mr Ison said: "It was to protect the party, sir."
There is no suggestion of any wrong-doing by Mr Farage or any other party official.
Sinclaire, 47, of Shirley, Solihull, West Midlands, denies misconduct in a public office between October 1 2009 and July 31 2010 while a serving member of the European Parliament by making or causing to be made false or dishonest claims for travel expenses.
She further denies a charge that between October 14 2009 and December 31 2010 she fraudulently transferred criminal property into her bank account.
The trial continues, with Sinclaire herself expected to give evidence next week.