Currently my company is contracted by another company. We work besides another big company where the employees of this companies inquire a lot from us. It has got to the point where we feel like we are spending too much time passing knowledge and time to them that we want it to stop completely. This is because my team also has its work to do. The problem is I do not know whether to report this to the client or not. It might seem like we are just selfish and we do not want to cause conflict since we all work in the same department (client) and office. What is the best way to approach this?
Contact your company liaison and ask them how they want you to handle this problem. Presumably they will not be interested in continuing to enable their competition to exploit your companies knowledge base when they are not being compensated for it.
However, it is not your place to make that decision. It could be that your company would rather continue this arrangement rather than risk causing problems with the client. They may wish to convey the issue to the client or address the issue directly with the other company. They may or may not give you direction in how to deal with the issue. But the first step should always be to consult your liaison for any issues you feel could be a problem for your company or contract with the client.
In addition to IDrinkandIKnowThings' answer. You mitigate against this from the start by being reticent with information. It's a good habit to form. It's the 'information age' it's currency. But since you didn't start like that it's not too late to change, just politely defer stuff.
'I'm busy right now.' 'Sorry, it's a difficult to explain and I don't have time' etc,.
Eventually they go look for an easier target or use an internet search engine.