While the iMac from 2006 through the mid 2007 release look like on the outside as if they are identical to the G5s that preceded them, they are not G5s except in form factor.
Similarly the PowerMac G5s, which look similar to the Mac Pros, are very different models. In addition to the processor change, Mac Pros have an extra optical drive bay.
The Intel Mac Minis have 4 USB ports on the back where the G4 Mac Minis have only 2.
Other models are more obvious whether they are Intel such as the MacBook Pro, and the MacBook and the new Aluminum clad iMacs with black rears and picture frames of the displays which are also Intel and not G5s.
To tell apart iMacs externally without turning them on, use this article as a guide:
and find out the equivalent EMC# on the base of the iMac.
A Brief Processor Architecture history:
1984 Early Macs used the 68000 processor family made by Motorola, from the 68000 to the 68040.
1994 Apple switched to PowerPC processors made by IBM and Motorola, (thus the term Power Mac). This started with the PowerPC 601 through 604e processors. Then the 3rd, 4th and 5th Generation PowerPC processors (G3, G4 and G5).
2006 Apple started using CPUs manufactured by Intel with the Core Solo and CoreDuo processors. These have now increased to faster Core2Duo and Xeon processors by Intel. Since the Intel processors are totally different processors, not an evolution of the PowerPC architecture, they do not carry the G5 or G6 nomenclature.