The double Olympic champion told Chinese media he had taken great pleasure in helping the men's 4x100 freestyle relay team beat the Japanese on Wednesday. He then indulged in a spot of diplomatic jousting.
"The Chinese let their anger out tonight," he is heard as saying on a Chinese-language audio passed to AFP.
"Honestly speaking the Japanese national anthem sounds ugly."
Sun is no stranger to controversy, getting himself suspended for six months after police detained him last year for colliding with a bus while driving a Porsche without a license last year.
More From This Section
Japan got off to a flying start over the first two days of the swimming competition, triggering an angry rant from a top Chinese swim official, who ordered Japanese swimmer Kosuke Hagino to sit down as he tried to leave a press conference.
China have since roared back to open a 15-8 lead in gold medals after four days, the last of their 15 titles coming in Wednesday's relay victory.
Sun won gold in the 400m freestyle, in which he is the Olympic champion, but blamed a thumb injury for his stunning defeat by Hagino in the 200m last weekend. The injury also forced him to switch to the third leg of the relay.
"There would have been an impact (on the race) if I was the leadoff swimmer as I could have had a weak start. But the coaches put me in third so there would be less pressure.
"Right now I'm struggling for speed and I would feel less pressure in there. We were ahead of Japan when I touched and I knew it would be no sweat for (Ning) to beat them given his speed," Sun said.