I think the quick way for this is to carry around marker variables, say b1,b2 and then compute the groebner basis of the ideal (b1-f1,b2-f2), making sure you have a block order that prioritizes the original variables (that occur in f1,f2). You can then see in the resulting basis from the part of the polynomials in the b1,b2 how your original generators were combined. It's comparable to the trick of augmenting a matrix for Gaussian elimination to find the transformation that gets you there (i.e., the inverse of the matrix).