She maintained she had collected her three-year-old in the car when her mother, who was meant to have been minding the child, got drunk.
O'Hagan, of Ardmore Lawns, Tallaght was fined €350 for assaulting Garda Mary Enneguess and driving without road tax.
She was also convicted of using threatening, abusive and insulting behaviour and having no NCT certificate.
O'Hagan had denied assaulting the garda but admitted the other charges. She insisted that while she "squared up to" the garda, she did not strike her.
Dublin District Court heard Garda Enneguess was on duty with Gardai Ciaran Moroney and Enda Daly when the accused was stopped driving at Firhouse Road West at 9.30pm on March 15 last.
There were five occupants including the defendant's daughter, who was not in a child seat. The tax was out since October 2010 and the NCT was valid to March 2010.
She was told her car was being seized and replied: "You are joking". When Garda Enneguess asked her to step out of the car, she said: "Shut up you g** bag".
O'Hagan stood out of the car, "squared up to" Garda Enneguess and repeated: "Shut the f*** up, you f***ing g**bag".
"She put her head back and proceeded to headbutt me", Garda Enneguess said.
"I was very shocked and appalled because it was only a car being seized," she added.
The defendant said in evidence that she had left her daughter with her mother by taxi, but had to return to collect her because her mother was drunk. She had no more money for a taxi and took her car.
"I thought it was bad because I was in my pyjamas, my baby was in her pyjamas, it was cold out and I had no way to get home," she said.
She maintained that after she called Garda Enneguess a "g**bag", she "squared up to" the garda without striking her.
Convicting the defendant, Judge William Early said: "The courts do not take kindly to members of the gardai being assaulted when they are performing their duties."