<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2024-03-11</periodOfReport>

    <issuer>
        <issuerCik>0001707753</issuerCik>
        <issuerName>Elastic N.V.</issuerName>
        <issuerTradingSymbol>ESTC</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001927549</rptOwnerCik>
            <rptOwnerName>Herzog Carolyn</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O ELASTIC N.V.</rptOwnerStreet1>
            <rptOwnerStreet2>88 KEARNY STREET, FLOOR 19</rptOwnerStreet2>
            <rptOwnerCity>SAN FRANCISCO</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>94108</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>Chief Legal Officer</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>1</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Ordinary Shares</value>
            </securityTitle>
            <transactionDate>
                <value>2024-03-11</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>2591</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>103.28</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>87799</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">The ordinary shares were sold to satisfy the Reporting Person's tax obligations in connection with the vesting of restricted stock units. This sale was mandated by the Issuer's equity incentive plan which requires the satisfaction of tax withholding obligations to be funded by a &quot;sell to cover&quot; transaction and does not represent a discretionary trade by the Reporting Person.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Marielle Reints, by power of attorney</signatureName>
        <signatureDate>2024-03-13</signatureDate>
    </ownerSignature>
</ownershipDocument>
