Ming Jiang spent £178,000 at 235 Casino in Manchester in the two weeks after he allegedly killed Yang Liu, Minshull Street Crown Court was told.
It is claimed Mr Jiang murdered the 36-year-old and dumped his body near a remote Derbyshire lay-by so he could use Mr Liu's funds to repay gambling debts of £273,115.
Mr Jiang, 43, denies murder.
The court was told the Chinese men were friends, but while Mr Liu was "comfortably off" in a Salford Quays apartment, Mr Jiang was living in a one-bedroom flat in Beswick and being chased by creditors.
The jury heard that after dismembering Mr Liu and leaving his torso in a suitcase near the A628 Woodhead Pass at Tintwistle, Mr Jiang returned to Manchester, withdrew £800 from his friend's account and went gambling.
Mr Liu's remains were found by walkers on 10 October, some days after it is believed he was killed.
A subsequent police search of Mr Jiang's home found an "extensive clean-up", prosecutor Peter Wright QC said.
The court heard officers found a bloody palm print on a box in the flat and Mr Liu's blood in the bathroom.
Mr Wright said following his arrest, the 43-year-old used an "elaborate smokescreen" of "slurs", including suggesting Mr Liu was a paid escort for older Chinese men, to conceal his guilt.
He told the court Mr Jiang used Mr Liu's bank and credit cards, reclaimed watches worth £16,000 from pawnbrokers, and took his friend's passport to try and achieve a "quick sale" of the quayside apartment.
He also said Mr Jiang had shipped seven boxes of Mr Liu's possessions to an address in Shanghai.
The trial continues.
An "insatiable gambler" murdered his friend to assume his identity and clear huge debts, a court has heard.