No, Jansenists did not deny the gratuity of grace
According to one of the foremost authorities on Jansenism, Dr. Shaun Blanchard, the Jansenists were fighting for the gratuity of grace!
The Augustinians who came to be known as Jansenists thought that this new system [of Molinism] was basically semi-Pelagian. It made humans the authors of their own salvation and sacrificed the total gratuity of grace.
-Are Jansenists Among Us?
Blanchard's extensive writings on the topic include some of the following:
Gratuity of Grace
Grace is not gratuitous precisely when it is earned or merited. One of the basic problems with Jansenism, as seen in the third condemned proposition of Cum Occasione, is that Jansenism makes it impossible for humans to merit. Therefore for Jansenists nothing can be earned or merited, including grace. And if grace cannot be merited, then it must be gratuitous.
The doctrine of irresistible grace is very much in keeping with the doctrine of the gratuity of grace, and those who hold to this doctrine often do so in order to safeguard the gratuity of grace. This was the case with the Jansenists. If one cannot resist something, then that thing is clearly not under their control. If one cannot resist grace, then grace is under God's control, not man's. This is very much in line with Ephesians 2 as quoted by the OP, "...it is the gift of God; not of works, that no man may glory..."
The denial of the gratuity of grace is characteristic of the Molinist Jesuits, who were the opponents of the Jansenists. The Molinists were accused of denying the gratuity of grace not only by Calvinists and Jansenists, but also by Thomists such as Domingo Báñez. The Jansenists were accused of denying the freedom of man (which was thought to be a denial of the ability to keep commandments, the ability to merit, the ability to resist grace, and the ability to cooperate with grace, which respectively align with the first four condemned propositions). This is the same thing that Calvinists and Thomists are often accused of.