Skyhawk 172/Cutlass 172
Flight Crew Instrument; Flight Crew Commercial; Flight Crew Flight Instructor; Flight Crew Multiengine
Communication Breakdown; Situational Awareness
Conflict NMAC
Flight Crew Took Evasive Action
Human Factors
Was told by ATC to follow the traffic in the downwind; saw traffic off to our right; I checked ADSB and looked for other traffic. Seeing nobody the student and I turned right to follow traffic just off of our right wing. Both the student and I realized that the traffic we were to follow was just above us because we made the turn too early. We dropped altitude immediately by 400 ft and let ATC know what happened. They had the traffic above us extend downwind for spacing.Corrective action would be to pay attention to understand specifically which traffic we were to follow and be sure to have the traffic visually before making a turn towards other traffic.
C172 instructor pilot reported an NMAC in the pattern at GFK following a misunderstanding as to their sequence.