"My heart exults in the LORD, my horn is exalted in my God. I have swallowed up my enemies; I rejoice in my victory. There is no Holy One like the LORD; there in no Rock like our God. (1 Sam 2:1-2)The words, structure, and rhythm are very similar. It's easy to imagine Mary drawing on her knowledge of Hannah's prayer when searching for adequate words to express herself. The Holy Father points out how "completely at home Mary is with the word of God". She "speaks and thinks with" it. Mary is a powerful example in prayer. We should follow her example, thinking and speaking with Scripture; God isn't going to accuse us of plagiarism!
Our prayers in the Mass, the Liturgy of the Hours, and the rosary follow this plan for Scriptural prayer. In fact, the USCCB has put an annotated Order of Mass online, which shows many of the connections back to Sacred Scripture. (We are Bible Christians!)
The idea is to speak with Scripture, not incidentally but purposefully, to use Scripture to help form our minds and hearts and words. The more we read and meditate on the written Word of God, the more it becomes part of us.
It's also interesting, though, how Scripture enters our speech without our awareness. There are many common expressions that I'm sure were originally spoken with Scripture in mind but now pass without much thought. Have you ever said that there's "nothing new under the sun"? Those words come from Ecclesiastes 1:9. Perhaps Job was the first to escape by the skin of his teeth (Job 19:20). The Prophet Jeremiah first asked if a leopard can change its spots (Jer 13:23), while the Psalmist first remarked on the things that come "out of the mouth of babes" (Ps 8:3). And it was Christ, Himself, that first warned about "the blind leading the blind" (Matt 15:14).
Lastly, Jesus spoke with Scripture as well, and the Gospel authors wrote with it, citing the Old Testament often. The Psalm above, in fact, is referenced by Christ when he asks "have you never read the text, 'Out of the mouths of infants and nurslings you have brought forth praise'?" (Matt 21:16)
So... can you "read the writing on the wall" (Dan 5:5)?