Erwin van de Looi's side went into Friday's Eredivisie clash in fine form, having reeled off three consecutive league victories.
Relegation-threatened Breda made Groningen work hard to make it four wins in a row, but Kostic struck at the death to move his side seven points clear of ninth-placed PEC Zwolle.
Nebojsa Gudelj's team, who are now winless in nine Eredivisie outings and remain just four points above the relegation play-off zone, frustrated their hosts in the first half, but Groningen midfielder Nick van der Velden broke the deadlock from the penalty spot 10 minutes after the interval.
Croatian forward Stipe Perica brought Breda level 18 minutes from time, the target man displaying his technical and physical prowess by chesting down a long ball in the Groningen area before turning deftly and slotting past Marco Bizot.
That goal looked to have secured a hard-earned point for the visitors, but Kostic had other ideas.
The Serbian, who had been booked for simulation in trying to win a penalty shortly before his winner, cut inside from the right and beat two defenders before firing low beyond Jelle ten Rouwelaar from 20 yards.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1