As a threshold issue, the question frames a situation in which a conflict of interest could sometimes arise. But the facts in the question really aren't rich enough for a full analysis of whether or not there is a conflict of interest.
This question is controlled (more or less entirely) by New Jersey Rule of Professional Conduct 1.9. This states:
Duties to Former Clients
(a) A lawyer who has represented a client in a matter shall not
thereafter represent another client in the same or a substantially
related matter in which that client's interests are materially adverse
to the interests of the former client unless the former client gives
informed consent confirmed in writing.
(b) A lawyer shall not knowingly represent a person in the same or a
substantially related matter in which a firm with which the lawyer
formerly was associated had previously represented a client,
(1) whose interests are materially adverse to that person; and
(2) about whom the lawyer, while at the former firm, had personally
acquired information protected by RPC 1.6 and RPC 1.9(c) that is
material to the matter unless the former client gives informed
consent, confirmed in writing.
Notwithstanding the other provisions of this paragraph, neither
consent shall be sought from the client nor screening pursuant to RPC
1.10 permitted in any matter in which the attorney had sole or primary responsibility for the matter in the previous firm.
(c) A lawyer who has formerly represented a client in a matter or
whose present or former firm has formerly represented a client in a
matter shall not thereafter:
(1) use information relating to the representation to the disadvantage
of the former client except as these Rules would permit or require
with respect to a client, or when the information has become generally
known; or
(2) reveal information relating to the representation except as these
Rules would permit or require with respect to a client.
(d) A public entity cannot consent to a representation otherwise
prohibited by this Rule.
Rule 1.9 also has official comments that would be highly persuasive:
Client-Lawyer Relationship
1 After termination of a client-lawyer relationship, a lawyer has
certain continuing duties with respect to confidentiality and
conflicts of interest and thus may not represent another client except
in conformity with this Rule. Under this Rule, for example, a lawyer
could not properly seek to rescind on behalf of a new client a
contract drafted on behalf of the former client. So also a lawyer who
has prosecuted an accused person could not properly represent the
accused in a subsequent civil action against the government concerning
the same transaction. Nor could a lawyer who has represented multiple
clients in a matter represent one of the clients against the others in
the same or a substantially related matter after a dispute arose among
the clients in that matter, unless all affected clients give informed
consent. See Comment [9]. Current and former government lawyers must
comply with this Rule to the extent required by Rule 1.11.
2 The scope of a "matter" for purposes of this Rule depends on the
facts of a particular situation or transaction. The lawyer's
involvement in a matter can also be a question of degree. When a
lawyer has been directly involved in a specific transaction,
subsequent representation of other clients with materially adverse
interests in that transaction clearly is prohibited. On the other
hand, a lawyer who recurrently handled a type of problem for a former
client is not precluded from later representing another client in a
factually distinct problem of that type even though the subsequent
representation involves a position adverse to the prior client.
Similar considerations can apply to the reassignment of military
lawyers between defense and prosecution functions within the same
military jurisdictions. The underlying question is whether the lawyer
was so involved in the matter that the subsequent representation can
be justly regarded as a changing of sides in the matter in question.
[3] Matters are "substantially related" for purposes of this Rule if
they involve the same transaction or legal dispute or if there
otherwise is a substantial risk that confidential factual information
as would normally have been obtained in the prior representation would
materially advance the client's position in the subsequent matter. For
example, a lawyer who has represented a businessperson and learned
extensive private financial information about that person may not then
represent that person's spouse in seeking a divorce. Similarly, a
lawyer who has previously represented a client in securing
environmental permits to build a shopping center would be precluded
from representing neighbors seeking to oppose rezoning of the property
on the basis of environmental considerations; however, the lawyer
would not be precluded, on the grounds of substantial relationship,
from defending a tenant of the completed shopping center in resisting
eviction for nonpayment of rent. Information that has been disclosed
to the public or to other parties adverse to the former client
ordinarily will not be disqualifying. Information acquired in a prior
representation may have been rendered obsolete by the passage of time,
a circumstance that may be relevant in determining whether two
representations are substantially related. In the case of an
organizational client, general knowledge of the client’s policies and
practices ordinarily will not preclude a subsequent representation; on
the other hand, knowledge of specific facts gained in a prior
representation that are relevant to the matter in question ordinarily
will preclude such a representation. A former client is not required
to reveal the confidential information learned by the lawyer in order
to establish a substantial risk that the lawyer has confidential
information to use in the subsequent matter. A conclusion about the
possession of such information may be based on the nature of the
services the lawyer provided the former client and information that
would in ordinary practice be learned by a lawyer providing such
services.
Lawyers Moving Between Firms [4] When lawyers have been associated
within a firm but then end their association, the question of whether
a lawyer should undertake representation is more complicated. There
are several competing considerations. First, the client previously
represented by the former firm must be reasonably assured that the
principle of loyalty to the client is not compromised. Second, the
rule should not be so broadly cast as to preclude other persons from
having reasonable choice of legal counsel. Third, the rule should not
unreasonably hamper lawyers from forming new associations and taking
on new clients after having left a previous association. In this
connection, it should be recognized that today many lawyers practice
in firms, that many lawyers to some degree limit their practice to one
field or another, and that many move from one association to another
several times in their careers. If the concept of imputation were
applied with unqualified rigor, the result would be radical
curtailment of the opportunity of lawyers to move from one practice
setting to another and of the opportunity of clients to change
counsel.
[5] Paragraph (b) operates to disqualify the lawyer only when the
lawyer involved has actual knowledge of information protected by Rules
1.6 and 1.9(c). Thus, if a lawyer while with one firm acquired no knowledge or information relating to a particular client of the firm,
and that lawyer later joined another firm, neither the lawyer
individually nor the second firm is disqualified from representing
another client in the same or a related matter even though the
interests of the two clients conflict. See Rule 1.10(b) for the
restrictions on a firm once a lawyer has terminated association with
the firm.
[6] Application of paragraph (b) depends on a situation's particular
facts, aided by inferences, deductions or working presumptions that
reasonably may be made about the way in which lawyers work together. A
lawyer may have general access to files of all clients of a law firm
and may regularly participate in discussions of their affairs; it
should be inferred that such a lawyer in fact is privy to all
information about all the firm's clients. In contrast, another lawyer
may have access to the files of only a limited number of clients and
participate in discussions of the affairs of no other clients; in the
absence of information to the contrary, it should be inferred that
such a lawyer in fact is privy to information about the clients
actually served but not those of other clients. In such an inquiry,
the burden of proof should rest upon the firm whose disqualification
is sought.
[7] Independent of the question of disqualification of a firm, a
lawyer changing professional association has a continuing duty to
preserve confidentiality of information about a client formerly
represented. See Rules 1.6 and 1.9(c).
[8] Paragraph (c) provides that information acquired by the lawyer in
the course of representing a client may not subsequently be used or
revealed by the lawyer to the disadvantage of the client. However, the
fact that a lawyer has once served a client does not preclude the
lawyer from using generally known information about that client when
later representing another client.
[9] The provisions of this Rule are for the protection of former
clients and can be waived if the client gives informed consent, which
consent must be confirmed in writing under paragraphs (a) and (b). See
Rule 1.0(e). With regard to the effectiveness of an advance waiver,
see Comment [22] to Rule 1.7. With regard to disqualification of a
firm with which a lawyer is or was formerly associated, see Rule 1.10.
There is also considerable commentary often in the form of official ethics opinions from a state attorney regulator or bar association, and case law interpreting this (which since it is largely uniform nationally includes case law from other states that is given great weight if there is no in state case law on point). The opinions and cases examine the general principles about in far more specific fact patterns which helps guide the analysis in a particular case.