A man raped a nine-year-old girl while her father went into the kitchen to make him a late-night coffee to help keep his mind off drugs, a Queensland court has heard.

The 37-year-old, who cannot be named for legal reasons, had been invited into the family's home to help him recover from his addiction when the alleged attack occurred.

After asking his host for a coffee, the man allegedly climbed into the child's bed and began raping her, the court was told.

He pleaded not guilty in the Brisbane District Court on Tuesday to two counts of rape and one of indecent treatment of a child between October 2013 and March 2014.

The court heard the girl's father had been playing chess with the man in the lounge room of the Brisbane home when he asked for a coffee and shower.