A journalist feared her contract with a Sunday tabloid would not be renewed unless she signed an affidavit about her relationship with Tommy Sheridan.
Paul Holleran told the court he was contacted by Anvar Khan
The Court of Session in Edinburgh heard the claim during the Scottish Socialist MSP's defamation action.
Paul Holleran, Scottish organiser of the National Union of Journalists, told jurors Anvar Khan had been put under pressure by the News of the World.
Mr Sheridan claims a series of articles about his sex life were untrue.
Mr Holleran, 50, said he was contacted by Miss Khan in October or November 2004 as she wanted advice on a contractual problem she was having with the News of the World, for which she was a columnist.
He said: "She was concerned that her contract was not going to be renewed unless she co-operated with the demands of the editor and signed an affidavit."
The witness said the man in question was Bob Bird, editor of the newspaper's Scottish edition.
Mr Holleran told the court Miss Khan did not want anything to do with the affidavit and could not see why it should affect her contract.
Mr Sheridan asked if Miss Khan had been placed under pressure to sign a legal document.
The witness replied: "Yes."
Anvar Khan claimed to have an affair with Mr Sheridan
Under cross-examination by Michael Jones QC, for the News of the World, Mr Holleran was questioned about the editors' Code of Practice, which regulates the Press.
He asked the witness if it was in the public interest to expose a politician, who was a leader of a mainstream party, who was guilty of hypocrisy.
Mr Holleran replied: "That would be."
Mr Jones later asked if Mr Holleran had asked Miss Khan's permission to give details about their confidential meetings.
Mr Holleran said: "I did not feel I had to."
Later the court heard that a story about Mr Sheridan having group sex in a hotel suite was offered to the Mail on Sunday after the women who made the claims had signed a £14,000 contract with the News of the World.
The Mail on Sunday's Scottish news editor said he had been contacted by a lawyer acting on behalf of Helen Allison and Anne Colvin, two months after the Glasgow MSP resigned as leader of the Scottish Socialist Party.
Jamie Macaskill said the solicitor had mentioned money the first time she called the Mail on Sunday and claimed its tabloid rival had offered her clients £20,000.
Actor Peter Mullan lent his support to Mr Sheridan and his wife
But after further inquiries Mr Macaskill and his editor decided to abandon the story when they agreed it would not provide "good value for money".
The jury previously heard Mrs Colvin, 54, contacted the News of the World in November 2004 after it printed an article which accused Mr Sheridan of having a four-year affair with former prostitute Fiona McGuire.
Both she and her friend, Ms Allison, 52, were later paid an advance of £1,000 each for their story and promised a further £6,000 when it was published.
But Mrs Colvin said negotiations broke down after the pair did not want their names and pictures to appear in the tabloid.
Day 17 of the civil action also had a touch of celebrity as award-winning actor Peter Mullan arrived in court for part of the morning session to lend his support to Mr Sheridan.
The star of My Name Is Joe and Young Adam left the court building at lunchtime, wearing a t-shirt and jeans, with his arm around Mr Sheridan, who was accompanied by his wife, Gail.
The trial continues.