The away victory — Bayern’s first at Leverkusen since 2013 — leaves them 14 points clear and on course for a sixth straight Bundesliga title as the German league resumed after the winter break.
Both Ribery and Bayern’s other veteran winger Arjen Robben, 34, are out of contract in June and the pair hope to be offered extensions in the coming weeks.
“I hope to get one, my goal is to stay in Munich as long as possible and to have fun with the fans and team,” Ribery replied when asked about a new contract.
“It’s always nice to score,” he added after his first league goal of the season.
“It’s tough to win at Leverkusen, but we played well here, although we need to move the ball more.”
Ribery, who has spent a decade at Bayern, rolled back the years by scything through Leverkusen’s defence and slamming home Bayern’s superb second goal.
Javi Martinez gave Bayern an early lead while Ribery’s super second-half strike made it 2-0.
Kevin Volland pulled a goal back for the hosts only for Bayern’s James Rodriguez to slot home a late free-kick.
The defeat broke Leverkusen’s 14-match unbeaten run in all competitions, dating back to the end of September, but the hosts stay fourth in the table.
– Heynckes’ surprise –
Bayern head coach Jupp Heynckes pulled a surprise before kick-off by leaving new signing Sandro Wagner on the bench until the final 15 minutes.
Bayern paid Hoffenheim around 13 million euros ($15.4m) last month for Wagner, who was signed as back-up for their top-scoring striker Robert Lewandowski.
The Poland star is returning to full training after a knee injury, but Heynckes opted to start Thomas Mueller up front for Bayern.
While goalkeeper Manuel Neuer is still recovering from a fractured foot, Mueller wore the captain’s armband and Sven Ulreich was in Bayern’s goal.
With Mats Hummels out with a groin injury, Niklas Suele partnered Jerome Boateng at centre-back.
Bayern took a deserved lead on 32 minutes when Martinez slammed home from close range.
Robben swung in a cross which Arturo Vidal headed on target, Bayer defender Sven Bender blocked the attempt, but the ball fell to Martinez who fired home.
Leverkusen’s Jamaica winger Leon Bailey threatened early in the second half.
The 20-year-old showed a glimpse of his talent by cutting in from the right, beating two players and clipped the crossbar with his shot.
Ribery then made sure of the three points on 59 minutes in emphatic style.
He dribbled his way through the defence then unleashed a thunderbolt of a shot which gave Leverkusen’s Germany goalkeeper Bernd Leno no chance.
However, the goal sparked Leverkusen into life.
Germany striker Volland, who is on the fringes of the national team, tested Ulreich and then took his chance.
The 25-year-old beat David Alaba, Ribery and Vidal, then wrong-footed Suele before firing home on 71 minutes.
However Rodriguez, on loan from Real Madrid, showed his class by cooly slotting home a free-kick on the edge of the area after being fouled just outside the box.
Download our app and read this and other great stories on the move. Available for Android and iOS.