Mark Brooks, 41, said he and Ms Pilley, 38, had met through an internet dating website, and she told him she had managed to “drum through” to David Gilroy, 49, the man accused of murdering her, that it was over between them.
On the night before Ms Pilley disappeared, she and Mr Brooks fell asleep in his flat watching a film on television, he told the High Court in Edinburgh. He drove her home next morning.
“I kissed her on the cheek and she got out of the car. I drove off and I could see her in the mirror. She waved and seemed very happy,” added Mr Brooks.
Earlier, Ms Pilley’s mother had spoken of her daughter’s “turbulent” relationship with Gilroy.
Sylvia Pilley, 69, recalled being told by her daughter how Gilroy had been jealous when she spoke to an old schoolfriend, and how she had decided to find someone else.
The last time they spoke, Ms Pilley had been about to set off to meet her new friend.
“She sounded quite happy, but at the same time she had been having second thoughts about David Gilroy. Should she go back to him or not?” said Mrs Pilley.
Gilroy, of Silverknowes Brae, Edinburgh, denies murdering Ms Pilley, of Whitson Road, Edinburgh, by unknown means on 4 May, 2010, at Thistle Street, Edinburgh, where they both worked for Infrastructure Management. Her body has never been found.
Mr Brooks, a planning officer for West Lothian Council, said he made contact with Ms Pilley on 12 April, 2010, through an internet dating website.
They seemed to share many interests, particularly outdoor activities such as cycling. They arranged to meet in a bar in the city centre but Ms Pilley called off at the last minute.
Another meeting was arranged, for Saturday, 1 May, and they spent several hours together in a bar.
“I was very attracted to Suzanne. She was a pretty girl and we had a lot in common,” said Mr Brooks.
He kissed her outside the bar, and they went to her flat to spend the night, although with no sexual contact. In the early hours, she woke him because she thought someone was outside the flat, but he heard nothing.
Ms Pilley had been due at his flat on the Sunday night. He was to cook her a meal but she sent a text message: “Sorry, I can’t come out tonight. It is complicated. I have got a visitor.”
Mr Brooks said he received another text the following morning, 3 May, a Monday holiday. Ms Pilley had written about having a “rubbish night” and that David had appeared and they argued, as she asked him to leave.
Mr Brooks said: “I decided maybe I should not contact her. I thought she seemed to be in a difficult romantic situation, and it was possibly best if I did not place any further pressure on her.
“She phoned and was apologising for the previous night. I said I could cook her that meal if she still wanted. She seemed pleased.”
He collected her from her flat and took her to his home. She stayed the night, and again there was no sex. Next morning they both had work, and he drove her home, and kissed her goodbye. He never saw her or heard from her again.