Both sides now have 45 points but Cologne lead on goal difference and occupy the last place to guarantee European qualification ahead of the rest of the 32nd round, after which two rounds remain.
"The team delivered in a brilliant way," Cologne sporting director Joerg Schmadtke said.
Modeste twice went close before breaking the deadlock in the 13th minute from close range.
Leonardo Bittencourt made it 2-0 shortly afterward only for Fin Bartels to pull one back with the outside of his boot, and Theodor Gebre Selassie equalised six minutes later. Both Bremen goals were set up by Zlatko Junuzovic.
But there was still time before the break for Modeste to set up Simon Zoller, and Modeste claimed his second goal right after the interval.
Modeste tried celebrating his 25th goal of the season with Cologne's mascot, a goat, before Bartels set up Serge Gnabry to score on his return from injury with a half-an-hour to play.
It proved an exciting finale. Modeste should have sealed the win on a break with five minutes with only the Bremen goalkeeper to beat.
Timo Horn was also called into action at the other end as Bremen kept pushing for the equaliser. Veteran striker Claudio Pizarro thought he had equalised but the effort was rightly ruled out for offside.
"We threw everything into it. With a bit of luck it would have been 4-4," Bartels said.