2-bit DAC from TTL logic using 2 MCU outputs
An NPN makes a poor high-side driver. The emitter voltage can never be higher than the base voltage minus \$V_{BE}\$. As you observed, you won't get more than 3.0V at the emitter under the best of circumstances.

You need to add a PNP transistor between +5V and R7. Use Q5, (along with resistors to limit the current) to provide the base current to the PNP.