In this work, we study the (2 + 1)-dimensional Dirac equation for a neutral fermion with magnetic dipole moment in the presence of an electromagnetic field. Next, we explicitly determine the eigenfunctions and the relativistic energy spectrum of the fermion. As result, we verified that these eigenfunctions are written in terms of the generalized Laguerre polynomials and the energy spectrum depends on the quantum numbers, n = 0,1,2,… and mj = 0,± 1,± 2,…, homogeneous magnetic field B, and of the cyclotron frequency ωAC generated by the electric field. Besides that, this energy spectrum may have finite or infinite degeneracy depending on the values of mj. In particular, we also verified that in the absence of the electric field (ωAC = 0), the energy spectrum reduces to a physical quantity (energy) that depends on the rest mass of the fermion and antifermion and of the magnetic field, already in the absence of the magnetic field (B = 0), the energy spectrum still remains quantized in terms of the quantum numbers n and mj; on the other hand, in the absence of the electromagnetic field (ωAC = B = 0), we get the rest energy of the fermion and antifermion. Finally, we compare our results with the literature, where we observe a similarity in some results of the Dirac oscillator.