I really hope you mean the Siege of Vienna in 1683, not the one of 1529, as only the former saw a significant Polish involvement, and is covered by the following text.
In 17th century, the Ottoman Empire was involved in several important conflicts with Poland, stemming from the Ottoman intent to expand north and Polish involvement in the politics of Wallachia, Moldavia and adjacent Balkan lands. Among another factors exacerbating Polish-Ottoman relationships were lack of control over Tartars (on the Ottoman side) and Zaporozhian Cossacks (on the Polish side) that were frequently involved in raids their nominal rulers were held responsible for (sack of Varna by Cossacks in 1620 was one of the secondary reasons for Polish Ottoman War that began that year). Additionally, Polish kings from Swedish Vasa dynasty (Sigismund III, Vladislav IV and John Casimir) were more or less friendly towards Habsburgs that were vying for power in the Balkans, what put them at loggerheads with Ottomans, also deeply interested in that region. All this meant that there was a significant enmity between Ottoman Empire and Polish-Lithuanian Commonwealth in the times we're speaking of.
The Polish involvement in the Siege of Vienna was a direct consequence of the Polish-Ottoman war of 1672, when the Ottomans exploited the internal political turmoil in Poland after the election of Michał I, supported by majority of lesser nobility (so-called malcontents) but heavily opposed by the influential rich aristocracy (called regalists). This conflict was so hot that it eclipsed the danger posed by Ottomans and when the parliament rejected the motion of increasing military spending due to regalists' policy based largely on personal animosity as Field Crown Hetman (de facto chief military commander) Jan Sobieski belonged to 'malcontents', Ottomans decided to use the opportunity. In late 1672 they attacked southeastern provinces of Poland, forcing unprepared Poles to accept failure after the capture of strategic fortress in Kamieniec Podolski. In the same year, Michał I signed the peace treaty in Buchach, granting Ottoman Empire Podolian and Kievan Voivodships and a part of Bracławian Voivodeship as well as agreed to pay a tribute to Sultan, making Poland a de iure Ottoman vassal. The defeat made Polish politician aware of instability they caused by infighting and the peace treaty was eventually not ratified by the parliament. The military budget was heavily increased and Polish-Lithuanian army was able to retaliate, defeating Ottomans at the battle of Khotyn in 1673. The same year Michal I died and Jan Sobieski, held as a national hero, was elected the next king. He managed to defeat Ottomans in the subsequent battles, leading to the peace treaty of Zhurawno in 1676, according to which Poland was no longer forced to pay tribute and regained approximately 1/3 of the lands lost due to Buchach treaty. So, as of 1676, i.e. 7 years prior to Siege if Vienna, Poland was ruled by a king famous for the victory over Ottomans, was still feeling the loss of the southeastern lands and fully aware that the Ottoman threat is still present.
Since 1673, Jan Sobieski, aware of the difficulties of fighting Ottomans alone, especially given additional troubles caused by Zaporozhian uprisings and conflicts with burgeoning Russian Kingdom, tried to build a strong anti-Ottoman alliance. Initially, he invited Sweden and France but as nether side was interested (Sweden was much more concerned with Russia and France was involved in several wars, while having good relationship with Ottoman Empire), and thus Polish king proposed the alliance to Habsburg Emperor, Leopold I. At first, he was reluctant to become involved in war, despite his pro-Polish policy as evidenced by the support he has given in the Second Northern War, but after Ottoman Empire started to concentrate large forces in Adrianopol and it became apparent that German princes won't be able to provide substantial help due to conflicts with France caused by the 'reunion policy' of Louis XIV, Leopold I agreed upon the military alliance with Poland, aided by Venice and mediated by the pope Innocent XI. According to the treaty (later known as the Treaty of Warsaw), signatories were obliged to render all military help possible to each other if the key cities (Krakow and Vienna) being endangered by mutual enemy. Additionally, upkeep of Polish troops was to be covered by the Emperor and Pope. At the moment of signing (1st April 1683) it was known that the large Ottoman army is moving north, but the direction of attack was not certain as Vienna was established as the main target only during the war council in Szekesfehervar in late May. Even then, the initial attack on Habsburg lands was directed towards Győr to hide the real target until last moment.
So, let's sum this up. In 1683, after successful diplomatic actions, Poland was able to secure strong and apparently sympathetic ally against common enemy known to prepare for the new offensive and organise significant funding for troops that could have been used to defend the country, regain lost lands or, with some luck, even expand further south. A decisive victory could even significantly cripple Ottoman military capability, securing southeastern border. All these goals were met - victory at Vienna facilitated the formation of the Holy League of 1684, uniting Austria, Poland, Venice, Papal States and Russia (since 1686) against the Ottomans and their vassals. Further military successes led to Peace Treaty of Karlowitz in 1699, where Poland regained lands lost in 1672 and Ottoman Empire never attempted any military action against Poland again.
The latter also turned the political situation of Poland inside out, as Ottomans became reluctant allies while Habsburg Austria turned into one of the main competitors, eventually taking parts in the partitions and final dissolution of the Polish state, but this is completely different story.