A convicted sex offender who was caught allegedly abducting a young girl in Sydney's south-west has been refused bail.

Christopher Irwin, 34, grabbed a seven-year-old girl while she was playing outside a relative's home in Macquarie Fields on Friday afternoon, police say.

The man allegedly took the girl into a nearby abandoned property and took off her jumper.

Two boys, who are neighbours, saw the man walk off with the girl and alerted her relatives who retrieved her, officers say.

One of the child's relatives described what happened.

"It was so quick, under five mins. She was in the driveway playing and then .... the man walked up and asked her, 'Do you want to see something cool?'" she said.

During a hearing at Parramatta Bail Court, the judge said despite saying no, Irwin took the girl into an empty property he had visited 14 times in the recent past.

"The boys were smashing doors and windows, we broke the back door but couldn't get the front open," the girl's relative said.

A neighbour has paid tribute to the young men who came to the child's rescue.

"If a young child has been grabbed in your own street, it's pretty upsetting," he said.

"Just thank god for the two young men who came to her rescue."

Charges laid over taking a child

Irwin, who also lives in Macquarie Fields, has been charged with taking a child with intent to remove parental control and remain in a building with intent to commit an indictable offence.

He has also been charged with two counts of breaching conditions of the child offender register.

He was previously convicted of using a carriage service to access child pornography.

In her reasons for denying bail, the judge acknowledged Irwin has an intellectual disability which she said made him vulnerable in custody but did not outweigh the risks to the community and to the victim if he were to be released on bail.

Irwin was living with his girlfriend, mother and stepfather.

He held his head in his hands while appearing before court via video link.

His bail was formally refused and he will appear before Campbelltown Local Court next Wednesday.