@mario one it's likely a loanword, the problem is whether it originated from Japanese (toshokan) or one of the dialects of Chinese (tushuguan)
It often depends on WHEN the word was loaned in, and who the major geopolitical power of the region was... some jp words sound like mandarin, or cantonese, depending on which dynasty was dominant then. Then chinese loaned in things like 電話 from jp during the imperial era, etc