Depending on the nature of the property, you may want to consult a real estate investment specialist and a tax accountant to determine whether you should purchase the property or not. In particular, whether or not it is possible to save on taxes depends on your own asset situation, etc., so you need to make a careful decision.
There is nothing wrong with investing in real estate for the first time, but it is important to understand that real estate investment is a business management.
In Japan, where the population is declining, it is not advisable to borrow money to build or purchase rental housing, even to save taxes, unless it is in a very good location. There is a real surplus of rental housing in Japan, and the vacancy rate is high.
There are many cases where people have started to manage rental housing, but cannot pay off their debts as the residents move to newer rental housing closer to the station.