Saraj Khan, 48, from Netherton, was caught on a security camera pouring liquid on the ground at the edge of the victim's residence in the same street.
Khan admitted to an offence of breaching a non-molestation order on September 28.
The case relates to a 12-month non-molestation order made against him at Wolverhampton Family Court on April 4, 2022.
Mr Zaine Riaz, prosecution, said: "On September 28, just before 9pm the victim was first alerted that the defendant had approached her property and was outside her gate by her CCTV.
"She saw the defendant appear to pour some liquid on the floor. After he poured the liquid, he then walked back to his property.
"The victim went to see what it was as she believed it was petrol. She reported this to the police and was subsequently arrested."
Defending Khan, Mr Abid Hussain, said: "He accepts he should never have gone near the property and should not have emptied the contents of his bottle of water outside the gates of the complainant's home.
"The complainant was concerned that it was petrol, but when the police attended there was no sign of it being petrol and the water had evaporated."
Mr Hussain added that his client had acted out of "pettiness".
The court heard that unemployed Khan Netherton has a previous conviction for assault.
Chairman of the bench, Mr Michael Woodhouse, sentenced him to a six-month community order and a six-month electronic tag curfew, meaning he must remain indoors between 6pm and 6am.
He was ordered to pay costs £185 and must pay the victims' surcharge £114.
He was also made subject to a 12-month restraining order preventing him from contacting the victim in any way and approaching the property.