Acknowledging funding originally intended for another purpose
This depends very strongly on your position and the nature of the grants.  The main deciding factors are:


Is your time clearly accounted to particular grants?  Postdocs are sometimes asked to fill out time-sheets that bill specific hours of work to specific grants, and sometimes simply "supported" by their grants.  If your hours are being specifically billed, then you must acknowledge funding on any publication that has had work billed to it (whether you should have done that is a different question).
How specific is the funding vehicle's mission and expectations?  For example, in the US, most NSF funding vehicles just want to see strong publications in an area plausibly related to the subject of the grant.  A DARPA contract, however, might be much more tightly focused and it could draw ire from the program manager if you appear to have been "wasting their money" on projects unrelated to the contract "mission."


The second point is very subjective and often depends strongly on not just the agency but the particular program manager and contract.  The PI of the grants should know the situation here, and be able to advise you on the preferred course of action.