[4] He made his debut in the top flight of Serbian football on 13 August 2011, playing the full 90 minutes in a 5–0 away loss against Partizan.
[7] He made his competitive debut for the club on 31 July, playing the full 90 minutes in a 2–1 away league loss to Napredak Kruševac.
[9] He subsequently established a formidable central defense partnership with Nikola Milenković, helping Partizan win the double.
[13] During a league game versus Rad on 7 March 2018, Ostojić suffered a ligament injury that caused him to miss the rest of the season.
He scored the only goal in the 2019 Serbian Cup final against arch-rivals Red Star Belgrade to help Partizan win the trophy for the fourth consecutive time.