Did Newton already have $F = ma$ (or equivalent) before finding his gravity equations? Newton's gravity equations are in an F = ma configuration. Multiply the acceleration formula by m, you get the force formula. So did he have F = ma (or some equivalent - I think the concept of acceleration may not have been a direct quantity in those days), before he got those two gravity equations? Did he get to one of them from the other, via F = ma?  
 A: Who knows? Perhaps. The beauty of physics is that researchers aid each other in new discoveries, theories, and derivations. It is no coincidence that Newton's gravity equations are intercorrelated with F=ma. Newton probably could not fully comprehend the second law of motion until much later. Perhaps he was too unsure of the result to publicly acknowledge it but knew of it long before it came into lighting. 
A: It is my understanding that both Newtons laws of motion and law of universal gravitation were formulated essentially at the same time (or at least published at the same time) in his book (translated from Latin): "Mathematical Principles of Natural Philosophy" first published in 1687.
I think of greater historical interest is that while Newton knew that gravitational mass, as determined by the law of universal gravitation, was equivalent to inertial mass, as determined by his second law $F=ma$, he failed to see the significance of that equivalence. It was the same case with Galileo. It was up to Einstein to interpret it as part of his equivalence principle of inertial and gravitational mass in his theory of general relativity.
Hope this helps.
A: Newton understood gravity as an acceleration of the earth's attraction, its true form would have been F=mg. What he did not know, was the gravity was not actually a force but a residue of many other factors - Einstein brought this to light by understanding the acceleration applied to all objects in the sense of a curvature of space. So yes, Newton did discover that the force would be equal to the mass of the object and the attraction - which today we know involves the acceleration, not a true physical force. 
