Yes, set your gmail account on your computer (via the web) to IMAP, set your gmail account in whatever desktop mac mail app you use as IMAP, set your iPhone gmail account as IMAP instead of POP3.
IMAP will function the way you need it to. You can read and delete (even move) emails on your computer and it will also happen on your phone and vice versa. If you use gmail on the web and you do not use a mail client then clearly skip that step.