A win for Bayern would have taken them to the top of the table, and Leon Goretzka's 33rd-minute effort sent the visitors ahead in Der Klassiker, before Leroy Sane doubled their advantage early in the second half.
Youssoufa Moukoko's 74th-minute strike for Dortmund halved the deficit, though, before Modeste spectacularly levelled in the final exchanges.
Donyell Malen had the first real chance in the 21st minute when he broke into a shooting position before attempting to pick out the back of the net, but the ball deflected off Matthijs de Ligt and wide of the target.
The first shot on target did not arrive until the 31st minute, with Manuel Neuer being forced into action to deny Raphael Guerreiro, with Malen involved in the build-up.
Bayern managed to make the breakthrough in the 33rd minute, though, with Goretzka finding the bottom-left corner with an excellent strike from outside the box.
Jamal Musiala provided the assist, with the youngster facing up two Dortmund defenders inside the penalty box before picking out his teammate, and Alexander Meyer was unsighted between the sticks.
BVB's best chance of a leveller came late in the first period through Malen, but the attacker's effort was saved by Neuer, who was the busier goalkeeper in the opening half of action.
Neuer had to make another smart save to keep out Marius Wolf's curling effort in the 47th minute, before Sadio Mane planted a header wide of the target down the other end two minutes later.
Bayern had their second in the 53rd minute, though, with Sane firing the ball through the hands of Meyer after Musiala had worked the ball to his teammate.
Musiala was denied by Meyer in the 64th minute before Goretzka fired wide of the post with a low effort 10 minutes later, and BVB made the most of the missed opportunities.
Indeed, Dortmund halved the deficit in the 74th minute when 17-year-old Moukoko found the back of the net with a clever finish after meeting a low cross from Guerreiro.
Modeste should have levelled for the home side late on, but he scuffed his effort, allowing Neuer to punch clear.
Modeste managed to score a second for Dortmund in the final seconds, though, as the striker headed home at the far post after Nico Schlotterbeck had delivered a excellent cross into the box.
Bayern remain in third spot in the table, one point behind the leaders Union Berlin, while Dortmund sit fourth, level on points with their opponents in Saturday's pulsating affair.