Actually, it's hard to say.
Google could consider these backlinks as attempts to increase PageRank and thus manipulate search rankings because the websites with the same IP address (the same server) are most probably from the same webmaster or company.
However, Google can't say these backlinks are useless for SEO (or can penalize websites) because in shared hosting, many websites have the same IP address and it's possible that one of these websites links yours. Moreover, even if the two websites have the same IP address (and are from the same webmaster or company), it can be relevant for visitors to link one to the other (for example if these two websites are related to the same theme).
In any case, Google can't be sure to be able to judge without analyzing other factors.
That's why I think it can be useful for SEO to link a website to another (even if the two websites have the same IP address) but you need to take precautions as following:
- these two websites are related to the same theme
- the link from one website to the other is useful and relevant
- there is no link exchange between the two websites