According to Bertil Gartner, “The second book of Maccabees lays more stress than the first on God’s intervention in history, the things that come to pass being the result of his governance [8:24, 35; 11:13; 12:11; 16:13; 17]. Thus, the author often repeats that the undertakings of the Jews are preceded by prayer and invocation [12:15, 28; 13:10; 14:15; 15:21 ff].”
I have included the RSV translation of 2 Maccabees passages involving prayer and invocation.
Did these passages inspire Luke?
15: But Judas and his men, calling upon the great Sovereign of the world, who without battering-rams or engines of war overthrew Jericho in the days of Joshua, rushed furiously upon the walls.
28: But the Jews called upon the Sovereign who with power shatters the might of his enemies, and they got the city into their hands, and killed as many as twenty-five thousand of those who were within it.
10: But when Judas heard of this, he ordered the people to call upon the Lord day and night, now if ever to help those who were on the point of being deprived of the law and their country and the holy temple,
11: and not to let the people who had just begun to revive fall into the hands of the blasphemous Gentiles.
12: When they had all joined in the same petition and had besought the merciful Lord with weeping and fasting and lying prostrate for three days without ceasing, Judas exhorted them and ordered them to stand ready.
13: After consulting privately with the elders, he determined to march out and decide the matter by the help of God before the king's army could enter Judea and get possession of the city.
14: So, committing the decision to the Creator of the world and exhorting his men to fight nobly to the death for the laws, temple, city, country, and commonwealth, he pitched his camp near Modein.
15: He gave his men the watchword, "God's victory," and with a picked force of the bravest young men, he attacked the king's pavilion at night and slew as many as two thousand men in the camp. He stabbed the leading elephant and its rider.
15: When the Jews heard of Nicanor's coming and the gathering of the Gentiles, they sprinkled dust upon their heads and prayed to him who established his own people for ever and always upholds his own heritage by manifesting himself.
21: Maccabeus, perceiving the hosts that were before him and the varied supply of arms and the savagery of the elephants, stretched out his hands toward heaven and called upon the Lord who works wonders; for he knew that it is not by arms, but as the Lord decides, that he gains the victory for those who deserve it.
22: And he called upon him in these words: "O Lord, thou didst send thy angel in the time of Hezekiah king of Judea, and he slew fully a hundred and eighty-five thousand in the camp of Sennacherib.
23: So now, O Sovereign of the heavens, send a good angel to carry terror and trembling before us.
24: By the might of thy arm may these blasphemers who come against thy holy people be struck down." With these words he ended his prayer.
25: Nicanor and his men advanced with trumpets and battle songs;
26: and Judas and his men met the enemy in battle with invocation to God and prayers.
27: So, fighting with their hands and praying to God in their hearts, they laid low no less than thirty-five thousand men, and were greatly gladdened by God's manifestation.
28: When the action was over and they were returning with joy, they recognized Nicanor, lying dead, in full armor.
29: Then there was shouting and tumult, and they blessed the Sovereign Lord in the language of their fathers.
30: And the man who was ever in body and soul the defender of his fellow citizens, the man who maintained his youthful good will toward his countrymen, ordered them to cut off Nicanor's head and arm and carry them to Jerusalem.
31: And when he arrived there and had called his countrymen together and stationed the priests before the altar, he sent for those who were in the citadel.
32: He showed them the vile Nicanor's head and that profane man's arm, which had been boastfully stretched out against the holy house of the Almighty;
33: and he cut out the tongue of the ungodly Nicanor and said that he would give it piecemeal to the birds and hang up these rewards of his folly opposite the sanctuary.
34: And they all, looking to heaven, blessed the Lord who had manifested himself, saying, "Blessed is he who has kept his own place undefiled."
35: And he hung Nicanor's head from the citadel, a clear and conspicuous sign to every one of the help of the Lord.
36: And they all decreed by public vote never to let this day go unobserved, but to celebrate the thirteenth day of the twelfth month -- which is called Adar in the Syrian language -- the day before Mordecai's day.
37: This, then, is how matters turned out with Nicanor. And from that time the city has been in the possession of the Hebrews. So I too will here end my story.
38: If it is well told and to the point, that is what I myself desired; if it is poorly done and mediocre, that was the best I could do.
39: For just as it is harmful to drink wine alone, or, again, to drink water alone, while wine mixed with water is sweet and delicious and enhances one's enjoyment, so also the style of the story delights the ears of those who read the work. And here will be the end.
Gospel of Luke