A first way is to use a list, visit the predecessor of each node starting from your node and put it in the list, building in this way a tree with the nodes you find.
Another way is to use a visit (DFS or BFS) on the graph reversing the edges.
Consider the following example where I build a bfs tree starting at Node "Q1".
import networkx as nx
g = nx.DiGraph()
g.add_edges_from([("M1","Q1"),("I1","M1"),("I2","M1"),("I3","M1"),("I3","M2"),("M2","Q2")])
#creating a graph with the edges reversed
g2 = nx.DiGraph()
g2.add_edges_from([(v,u) for (u,v) in g.edges()])
t = nx.bfs_tree(g2, "Q1")
for (u,v) in t.edges():
t.remove_edge(u,v)
t.add_edge(v,u)
print(t.nodes(),t.edges())
# ['Q1', 'M1', 'I1', 'I2', 'I3'] [('M1', 'Q1'), ('I1', 'M1'), ('I2', 'M1'), ('I3', 'M1')]