Brett - who also faces a betting charge - was given an eight-match ban in total following a Scottish Football Association disciplinary tribunal, but half of the punishment is suspended.
The outcome of the hearing has been confirmed by Cowdenbeath, who suspended Brett earlier this week over the betting allegations.
A club statement read: "Following a hearing at Hampden Park, the tribunal found that between 23 May 2016 and 5 November 2016 Dean made comments upon a social networking site, namely Twitter, that were of a discriminatory, and offensive nature, based upon sexual orientation as well as comments that were otherwise of an offensive nature."
Brett will serve the full ban if he further breaches the disciplinary rules or fails to attend equality and social media training
The 24-year-old faces further punishment after admitting betting against Cowdenbeath on several occasions
Brett spoke out this week about his gambling addiction, which he stated grew worse following the deaths of his daughter and partner
The Ladbrokes League Two bottom club revealed earlier this week that a Gambling Commission report confirmed Brett had made 2,787 bets on 6,369 matches since the 2011-12 season
He bet on Cowdenbeath to lose on eight occasions, five times in games he was playing in
Source : PA