It can be done in 1 select. If you only want the first 4 email addresses and use them as specific columns. Use the RowNumber function on the email table to number the mailaddresses per user. This example assumes the email addresses should be sorted alphabetically:
with m as (
select
ROW_NUMBER() over (partition by nameId order by email) as Nr,
email.NameId, email.Email
from email
)
select
name.NameId,
name.Name,
m1.Email as Mail1,
m2.Email as Mail2,
m3.Email as Mail3,
m4.Email as Mail4
from name
left join m m1 on (m1.Nr=1 and m1.NameId=name.NameId)
left join m m2 on (m2.Nr=2 and m2.NameId=name.NameId)
left join m m3 on (m3.Nr=3 and m3.NameId=name.NameId)
left join m m4 on (m4.Nr=4 and m4.NameId=name.NameId)